machine config for chupacabra
This commit is contained in:
		
							parent
							
								
									a303e5c14d
								
							
						
					
					
						commit
						4a049b08b1
					
				
					 2 changed files with 53 additions and 3 deletions
				
			
		
							
								
								
									
										49
									
								
								system/machines/chupacabra.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								system/machines/chupacabra.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,49 @@
 | 
				
			||||||
 | 
					{ config, lib, pkgs, ... }:
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  imports = [
 | 
				
			||||||
 | 
					    ../modules/reusable/battery.nix
 | 
				
			||||||
 | 
					    <nixos-hardware/common/cpu/intel>
 | 
				
			||||||
 | 
					    <nixos-hardware/common/pc/laptop>
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  networking.hostName = "chupacabra";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  powerManagement = {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					    powertop.enable = true;
 | 
				
			||||||
 | 
					    cpuFreqGovernor = "performance";
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  laptop.onLowBattery = {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					    action = "hibernate";
 | 
				
			||||||
 | 
					    thresholdPercentage = 5;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  boot.initrd.luks.devices."cryptswap".device = "/dev/disk/by-uuid/3b6e2fd4-bfe9-4392-a6e0-4f3b3b76e019";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  boot.kernelParams = [ "acpi_rev_override" ];
 | 
				
			||||||
 | 
					  services.thermald.enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Intel-only graphics
 | 
				
			||||||
 | 
					  hardware.nvidiaOptimus.disable = true;
 | 
				
			||||||
 | 
					  boot.blacklistedKernelModules = [ "nouveau" "intel" ];
 | 
				
			||||||
 | 
					  services.xserver.videoDrivers = [ "intel" ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Nvidia Optimus (hybrid) - currently not working
 | 
				
			||||||
 | 
					  # services.xserver.videoDrivers = [ "intel" "nvidia" ];
 | 
				
			||||||
 | 
					  # boot.blacklistedKernelModules = [ "nouveau" "bbswitch" ];
 | 
				
			||||||
 | 
					  # boot.extraModulePackages = [ pkgs.linuxPackages.nvidia_x11 ];
 | 
				
			||||||
 | 
					  # hardware.bumblebee.enable = true;
 | 
				
			||||||
 | 
					  # hardware.bumblebee.pmMethod = "none";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  systemd.services.disable-usb-autosuspend = {
 | 
				
			||||||
 | 
					    description = "Disable USB autosuspend";
 | 
				
			||||||
 | 
					    wantedBy = [ "multi-user.target" ];
 | 
				
			||||||
 | 
					    serviceConfig = { Type = "oneshot"; };
 | 
				
			||||||
 | 
					    unitConfig.RequiresMountsFor = "/sys";
 | 
				
			||||||
 | 
					    script = ''
 | 
				
			||||||
 | 
					      echo -1 > /sys/module/usbcore/parameters/autosuspend
 | 
				
			||||||
 | 
					    '';
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -6,12 +6,12 @@
 | 
				
			||||||
      ./xserver.nix
 | 
					      ./xserver.nix
 | 
				
			||||||
      ./emacs.nix
 | 
					      ./emacs.nix
 | 
				
			||||||
      ./sound.nix
 | 
					      ./sound.nix
 | 
				
			||||||
 | 
					      ./urbint.nix
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  boot.loader.systemd-boot.enable = true;
 | 
					  boot.loader.systemd-boot.enable = true;
 | 
				
			||||||
  boot.loader.efi.canTouchEfiVariables = true;
 | 
					  boot.loader.efi.canTouchEfiVariables = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  networking.hostName = "bumblebee";
 | 
					 | 
				
			||||||
  networking.useDHCP = false;
 | 
					  networking.useDHCP = false;
 | 
				
			||||||
  networking.networkmanager.enable = true;
 | 
					  networking.networkmanager.enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -65,9 +65,10 @@
 | 
				
			||||||
    isNormalUser = true;
 | 
					    isNormalUser = true;
 | 
				
			||||||
    initialPassword = "password";
 | 
					    initialPassword = "password";
 | 
				
			||||||
    extraGroups = [
 | 
					    extraGroups = [
 | 
				
			||||||
      "wheel"  # Enable ‘sudo’ for the user.
 | 
					      "wheel"
 | 
				
			||||||
      "networkmanager"
 | 
					      "networkmanager"
 | 
				
			||||||
      "audio"
 | 
					      "audio"
 | 
				
			||||||
 | 
					      "docker"
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    shell = pkgs.zsh;
 | 
					    shell = pkgs.zsh;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
| 
						 | 
					@ -90,7 +91,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  powerManagement = {
 | 
					  powerManagement = {
 | 
				
			||||||
    enable = true;
 | 
					    enable = true;
 | 
				
			||||||
    cpuFreqGovernor = "powersave";
 | 
					    cpuFreqGovernor = lib.mkDefault "powersave";
 | 
				
			||||||
    powertop.enable = true;
 | 
					    powertop.enable = true;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
  # Hibernate on low battery
 | 
					  # Hibernate on low battery
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue