diff --git a/hosts/common/configs/system/nixpkgs/default.nix b/hosts/common/configs/system/nixpkgs/default.nix index 14d9d03..60acaf1 100644 --- a/hosts/common/configs/system/nixpkgs/default.nix +++ b/hosts/common/configs/system/nixpkgs/default.nix @@ -1,6 +1,9 @@ -{ inputs, ... }: +{ inputs, system, ... }: { imports = [ inputs.nur.modules.nixos.default ]; - nixpkgs.config.allowUnfree = true; + nixpkgs = { + hostPlatform = system; + config.allowUnfree = true; + }; } diff --git a/hosts/common/configs/system/powertop/default.nix b/hosts/common/configs/system/powertop/default.nix index 774061d..199bb2f 100644 --- a/hosts/common/configs/system/powertop/default.nix +++ b/hosts/common/configs/system/powertop/default.nix @@ -2,4 +2,5 @@ { environment.systemPackages = with pkgs; [ powertop ]; powerManagement.powertop.enable = true; + systemd.services.powertop.postStart = builtins.readFile ./mouse.sh; } diff --git a/hosts/eirene/hardware/scripts/mouse.sh b/hosts/common/configs/system/powertop/mouse.sh similarity index 93% rename from hosts/eirene/hardware/scripts/mouse.sh rename to hosts/common/configs/system/powertop/mouse.sh index a234006..dc0f6ea 100644 --- a/hosts/eirene/hardware/scripts/mouse.sh +++ b/hosts/common/configs/system/powertop/mouse.sh @@ -1,6 +1,5 @@ SEARCH_STRINGS=( "Mouse" - "Razer DeathAdder Elite" "Razer DeathAdder V3 HyperSpeed" ) diff --git a/hosts/common/configs/user/gui/obs/options.nix b/hosts/common/configs/user/gui/obs/options.nix index 723692c..3339a12 100644 --- a/hosts/common/configs/user/gui/obs/options.nix +++ b/hosts/common/configs/user/gui/obs/options.nix @@ -8,11 +8,13 @@ x = mkOption { type = int; description = "Base resolution width."; + default = 1920; }; y = mkOption { type = int; description = "Base resolution height."; + default = 1080; }; }; @@ -20,11 +22,13 @@ x = mkOption { type = int; description = "Output resolution width."; + default = 1920; }; y = mkOption { type = int; description = "Output resolution height."; + default = 1080; }; }; }; diff --git a/hosts/eirene/hardware/scripts/card.sh b/hosts/eirene/hardware/card.sh similarity index 100% rename from hosts/eirene/hardware/scripts/card.sh rename to hosts/eirene/hardware/card.sh diff --git a/hosts/eirene/hardware/default.nix b/hosts/eirene/hardware/default.nix index 889b43b..0abe4b3 100644 --- a/hosts/eirene/hardware/default.nix +++ b/hosts/eirene/hardware/default.nix @@ -62,23 +62,17 @@ ]; }; - nixpkgs = { - hostPlatform = "x86_64-linux"; - - config = { - cudaSupport = true; - rocmSupport = true; - }; + nixpkgs.config = { + cudaSupport = true; + rocmSupport = true; }; powerManagement.enable = true; - systemd.services.powertop.postStart = builtins.readFile ./scripts/mouse.sh; - services = { xserver.videoDrivers = [ "nvidia" ]; fstrim.enable = true; - tlp.settings.DISK_DEVICES = "nvme0n1 nvme1n1"; + tlp.settings.DISK_DEVICES = lib.mkDefault "nvme0n1 nvme1n1"; }; programs.gamescope.env = { @@ -100,7 +94,7 @@ gestures.workspace_swipe_distance = 600; }; - programs.zsh.loginExtra = lib.mkBefore (builtins.readFile ./scripts/card.sh); + programs.zsh.loginExtra = lib.mkBefore (builtins.readFile ./card.sh); } ]; } diff --git a/hosts/elara/default.nix b/hosts/elara/default.nix index 1a0cb4d..da0b5a5 100644 --- a/hosts/elara/default.nix +++ b/hosts/elara/default.nix @@ -8,8 +8,6 @@ device = "/dev/disk/by-id/ata-Samsung_SSD_990_EVO_1TB_S7GCNL0XA04998F"; }) ./hardware - # elara runs on an external drive on eirene - ../eirene/hardware ../common/configs/system/backup ../common/configs/system/bluetooth diff --git a/hosts/elara/hardware/default.nix b/hosts/elara/hardware/default.nix index 7b6fafe..c6f8bfb 100644 --- a/hosts/elara/hardware/default.nix +++ b/hosts/elara/hardware/default.nix @@ -5,4 +5,15 @@ "uas" "sd_mod" ]; + + services.tlp.settings.DISK_DEVICES = "sda"; + + # By default, this host runs on an external SSD attached to eirene... + imports = [ ../../eirene/hardware ]; + + # ...but it can also run attached to a SAS-provided laptop. + specialisation.sas.configuration = { + disabledModules = [ ../../eirene/hardware ]; + imports = [ ./sas ]; + }; } diff --git a/hosts/elara/hardware/sas/default.nix b/hosts/elara/hardware/sas/default.nix new file mode 100644 index 0000000..3c75e5d --- /dev/null +++ b/hosts/elara/hardware/sas/default.nix @@ -0,0 +1,29 @@ +{ ... }: +{ + imports = [ + ./display.nix + ]; + + hardware = { + enableAllFirmware = true; + + cpu = { + cores = 8; + threads = 12; + intel.updateMicrocode = true; + }; + }; + + boot = { + kernelModules = [ "kvm-intel" ]; + initrd.kernelModules = [ + "thunderbolt" + "vmd" + "nvme" + ]; + }; + + powerManagement.enable = true; + + services.fstrim.enable = true; +} diff --git a/hosts/elara/hardware/sas/display.nix b/hosts/elara/hardware/sas/display.nix new file mode 100644 index 0000000..4735b65 --- /dev/null +++ b/hosts/elara/hardware/sas/display.nix @@ -0,0 +1,28 @@ +{ ... }: +{ + boot.kernelParams = [ "video=eDP-1:1920x1200@60" ]; + + home-manager.sharedModules = [ + { + wayland.windowManager.hyprland.settings.monitor = "eDP-1, 1920x1200@60, 0x0, 1"; + + programs = { + vscode.userSettings."window.zoomLevel" = (1.25 - 1) / 0.2; + + obs-studio.resolution = { + base = { + x = 1920; + y = 1200; + }; + + output = { + x = 1920; + y = 1200; + }; + }; + }; + + theme.cursor.size = 24; + } + ]; +} diff --git a/hosts/installer/hardware/default.nix b/hosts/installer/hardware/default.nix index f49890e..65338c8 100644 --- a/hosts/installer/hardware/default.nix +++ b/hosts/installer/hardware/default.nix @@ -1,6 +1,6 @@ { ... }: { - hardware.enableAllFirmware = true; + hardware.enableAllHardware = true; boot.initrd.kernelModules = [ "nvme" @@ -11,7 +11,5 @@ "sd_mod" ]; - nixpkgs.hostPlatform = "x86_64-linux"; - services.fstrim.enable = true; }