about summary refs log tree commit diff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/machines/chupacabra.nix49
-rw-r--r--system/modules/common.nix7
2 files changed, 53 insertions, 3 deletions
diff --git a/system/machines/chupacabra.nix b/system/machines/chupacabra.nix
new file mode 100644
index 000000000000..a283346ad509
--- /dev/null
+++ b/system/machines/chupacabra.nix
@@ -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
+    '';
+  };
+}
diff --git a/system/modules/common.nix b/system/modules/common.nix
index 27f4a73f09e9..008863bdbfac 100644
--- a/system/modules/common.nix
+++ b/system/modules/common.nix
@@ -6,12 +6,12 @@
       ./xserver.nix
       ./emacs.nix
       ./sound.nix
+      ./urbint.nix
     ];
 
   boot.loader.systemd-boot.enable = true;
   boot.loader.efi.canTouchEfiVariables = true;
 
-  networking.hostName = "bumblebee";
   networking.useDHCP = false;
   networking.networkmanager.enable = true;
 
@@ -65,9 +65,10 @@
     isNormalUser = true;
     initialPassword = "password";
     extraGroups = [
-      "wheel"  # Enable ‘sudo’ for the user.
+      "wheel"
       "networkmanager"
       "audio"
+      "docker"
     ];
     shell = pkgs.zsh;
   };
@@ -90,7 +91,7 @@
 
   powerManagement = {
     enable = true;
-    cpuFreqGovernor = "powersave";
+    cpuFreqGovernor = lib.mkDefault "powersave";
     powertop.enable = true;
   };
   # Hibernate on low battery