From d24efeba64e25c331be2c6a0b449b864dfecc199 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Thu, 12 Oct 2023 20:35:39 -0400 Subject: [PATCH] game-laptop -> game-desktop --- .sops.yaml | 4 +- README.md | 2 +- flake.nix | 4 +- hosts/{game-laptop => game-desktop}/disko.nix | 0 hosts/{game-laptop => game-desktop}/main.nix | 32 +++++++++++++-- .../secrets.yaml | 0 hosts/game-laptop/prime.nix | 30 -------------- hosts/gerg-desktop/services/postgresql.nix | 10 +++-- hosts/moms-laptop/main.nix | 10 +++-- lib/default.nix | 3 +- modules/DE/dwm.nix | 38 +++++++++--------- modules/builders.nix | 40 ++++++++++--------- modules/keys.nix | 2 +- modules/systemd-boot/default.nix | 23 +++++------ modules/theming.nix | 10 +++-- 15 files changed, 105 insertions(+), 103 deletions(-) rename hosts/{game-laptop => game-desktop}/disko.nix (100%) rename hosts/{game-laptop => game-desktop}/main.nix (76%) rename hosts/{game-laptop => game-desktop}/secrets.yaml (100%) delete mode 100644 hosts/game-laptop/prime.nix diff --git a/.sops.yaml b/.sops.yaml index a7ebec7..c04790b 100644 --- a/.sops.yaml +++ b/.sops.yaml @@ -1,7 +1,7 @@ keys: - &gerg-desktop age180y8kdtdlqelayyz9mq2c7xv248rh4gdfr3amjzvdcjrz6wdaqmsj762pp - &moms-laptop age1vxx3qdsucv2v2slag67c4f0kwd8jtta4tue6m8d9xfl4ryrqvyusxgwl68 - - &game-laptop age1egxes320renph0uevtmnsz4d5aw0z794c5nwrk2z6249wv2yevgqx9cf90 + - &game-desktop age1egxes320renph0uevtmnsz4d5aw0z794c5nwrk2z6249wv2yevgqx9cf90 creation_rules: - path_regex: hosts/gerg-desktop/secrets.yaml$ key_groups: @@ -15,6 +15,6 @@ creation_rules: - path_regex: hosts/game-laptop/secrets.yaml$ key_groups: - age: - - *game-laptop + - *game-desktop - *gerg-desktop diff --git a/README.md b/README.md index 030e5d5..6acaf9c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ it currently has 3 hosts: "gerg-desktop" my main computer [specs](https://pcpartpicker.com/list/DVkMk9) which I run a windows KVM VFIO virtual machine on -"game-laptop" a HP Pavilion Laptop [15-ec2121nr](https://support.hp.com/us-en/document/c07918617#AbT0) +"game-desktop" a HP Pavilion Laptop [15-ec2121nr](https://support.hp.com/us-en/document/c07918617#AbT0) which I've been testing linux game compatability on "moms-laptop" a TOSHIBA Satellite [L855-S5309](https://fo-stage-03.icecat.biz/us/p/toshiba/pskfuu-008049/satellite-notebooks-l855-s5309-18316794.html) diff --git a/flake.nix b/flake.nix index 8764729..819ad2c 100644 --- a/flake.nix +++ b/flake.nix @@ -56,7 +56,7 @@ inherit lib; nixosConfigurations = lib.mkHosts "x86_64-linux" [ "gerg-desktop" - "game-laptop" + "game-desktop" "moms-laptop" "iso" ]; @@ -65,7 +65,7 @@ diskoConfigurations = lib.mkDisko [ "gerg-desktop" - "game-laptop" + "game-desktop" "moms-laptop" ]; formatter.${system} = pkgs.writeShellApplication { diff --git a/hosts/game-laptop/disko.nix b/hosts/game-desktop/disko.nix similarity index 100% rename from hosts/game-laptop/disko.nix rename to hosts/game-desktop/disko.nix diff --git a/hosts/game-laptop/main.nix b/hosts/game-desktop/main.nix similarity index 76% rename from hosts/game-laptop/main.nix rename to hosts/game-desktop/main.nix index 33590ea..6e7dcbe 100644 --- a/hosts/game-laptop/main.nix +++ b/hosts/game-desktop/main.nix @@ -77,6 +77,28 @@ _: }; }; }; + + hardware.nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.latest; + nvidiaPersistenced = true; + nvidiaSettings = false; + modesetting.enable = true; + }; + services.xserver = { + videoDrivers = [ "nvidia" ]; + #disable DPMS + monitorSection = '' + Option "DPMS" "false" + ''; + #disable screen blanking in total + serverFlagsSection = '' + Option "StandbyTime" "0" + Option "SuspendTime" "0" + Option "OffTime" "0" + Option "BlankTime" "0" + ''; + }; + hardware.bluetooth.enable = true; services.blueman.enable = true; boot = { @@ -88,10 +110,12 @@ _: kernelModules = [ "kvm-amd" ]; kernelPackages = pkgs.linuxPackages_latest; }; - swapDevices = [ { - device = "/swapfile"; - size = 16 * 1024; - } ]; + swapDevices = [ + { + device = "/swapfile"; + size = 16 * 1024; + } + ]; system.stateVersion = "23.05"; _file = ./main.nix; diff --git a/hosts/game-laptop/secrets.yaml b/hosts/game-desktop/secrets.yaml similarity index 100% rename from hosts/game-laptop/secrets.yaml rename to hosts/game-desktop/secrets.yaml diff --git a/hosts/game-laptop/prime.nix b/hosts/game-laptop/prime.nix deleted file mode 100644 index 8368a73..0000000 --- a/hosts/game-laptop/prime.nix +++ /dev/null @@ -1,30 +0,0 @@ -_: -{ config, ... }: -{ - hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.latest; - prime = { - sync.enable = true; - amdgpuBusId = "PCI:5:0:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - nvidiaPersistenced = true; - nvidiaSettings = false; - modesetting.enable = true; - }; - services.xserver = { - videoDrivers = [ "nvidia" ]; - #disable DPMS - monitorSection = '' - Option "DPMS" "false" - ''; - #disable screen blanking in total - serverFlagsSection = '' - Option "StandbyTime" "0" - Option "SuspendTime" "0" - Option "OffTime" "0" - Option "BlankTime" "0" - ''; - }; - _file = ./prime.nix; -} diff --git a/hosts/gerg-desktop/services/postgresql.nix b/hosts/gerg-desktop/services/postgresql.nix index 164396d..0073ef4 100644 --- a/hosts/gerg-desktop/services/postgresql.nix +++ b/hosts/gerg-desktop/services/postgresql.nix @@ -10,10 +10,12 @@ _: "miniflux" config.services.gitea.database.user ]; - ensureUsers = [ { - name = "miniflux"; - ensurePermissions."DATABASE miniflux" = "ALL PRIVILEGES"; - } ]; + ensureUsers = [ + { + name = "miniflux"; + ensurePermissions."DATABASE miniflux" = "ALL PRIVILEGES"; + } + ]; settings.unix_socket_permissions = "0770"; }; diff --git a/hosts/moms-laptop/main.nix b/hosts/moms-laptop/main.nix index 28b8549..a2a2a28 100644 --- a/hosts/moms-laptop/main.nix +++ b/hosts/moms-laptop/main.nix @@ -91,9 +91,11 @@ _: system.stateVersion = "23.05"; - swapDevices = [ { - device = "/swapfile"; - size = 8 * 1024; - } ]; + swapDevices = [ + { + device = "/swapfile"; + size = 8 * 1024; + } + ]; _file = ./main.nix; } diff --git a/lib/default.nix b/lib/default.nix index aca9d31..6f869fe 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -39,8 +39,7 @@ in if config == { } then unstable.legacyPackages.${system} else - import unstable { inherit system config; } - ; + import unstable { inherit system config; }; } ) [ "x86_64-linux" ] diff --git a/modules/DE/dwm.nix b/modules/DE/dwm.nix index 61fc712..c52a9a8 100644 --- a/modules/DE/dwm.nix +++ b/modules/DE/dwm.nix @@ -22,26 +22,28 @@ ''; defaultSession = "none+dwm"; }; - windowManager.session = [ { - name = "dwm"; - start = '' - update_time () { - while : - do - sleep 1 - xsetroot -name "$(date +"%I:%M %p")" - done - } + windowManager.session = [ + { + name = "dwm"; + start = '' + update_time () { + while : + do + sleep 1 + xsetroot -name "$(date +"%I:%M %p")" + done + } - dont_stop() { - while type dwm >/dev/null ; do dwm && continue || break ; done - } + dont_stop() { + while type dwm >/dev/null ; do dwm && continue || break ; done + } - update_time & - dont_stop & - waitPID=$! - ''; - } ]; + update_time & + dont_stop & + waitPID=$! + ''; + } + ]; }; environment.systemPackages = builtins.attrValues { inherit (suckless.packages.${pkgs.system}) dmenu dwm st; diff --git a/modules/builders.nix b/modules/builders.nix index cffa86e..fb02d60 100644 --- a/modules/builders.nix +++ b/modules/builders.nix @@ -19,24 +19,26 @@ _: ]; }; distributedBuilds = true; - buildMachines = [ { - hostName = "gerg-desktop"; - protocol = "ssh-ng"; - maxJobs = 32; - systems = [ - "x86_64-linux" - "i686-linux" - ]; - supportedFeatures = [ - "big-parallel" - "nixos-test" - "kvm" - "benchmark" - ]; - sshUser = "builder"; - sshKey = "/etc/ssh/ssh_host_ed25519_key"; - publicHostKey = config.local.keys.gerg-desktop_fingerprint; - } ]; + buildMachines = [ + { + hostName = "gerg-desktop"; + protocol = "ssh-ng"; + maxJobs = 32; + systems = [ + "x86_64-linux" + "i686-linux" + ]; + supportedFeatures = [ + "big-parallel" + "nixos-test" + "kvm" + "benchmark" + ]; + sshUser = "builder"; + sshKey = "/etc/ssh/ssh_host_ed25519_key"; + publicHostKey = config.local.keys.gerg-desktop_fingerprint; + } + ]; }; programs.ssh.knownHosts = { gerg-desktop = { @@ -50,7 +52,7 @@ _: let keys = [ config.local.keys.root_moms-laptop - config.local.keys.root_game-laptop + config.local.keys.root_game-desktop ]; in lib.mkIf config.local.remoteBuild.isBuilder { diff --git a/modules/keys.nix b/modules/keys.nix index 1bbd733..8160fd8 100644 --- a/modules/keys.nix +++ b/modules/keys.nix @@ -7,7 +7,7 @@ _: gerg_gerg-phone = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDU6BnoHIgMLgZVGuvi03J9l5Z1yP1P5Q8QPyjRHyi77"; gerg_gerg-windows = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILpYY2uw0OH1Re+3BkYFlxn0O/D8ryqByJB/ljefooNc"; root_moms-laptop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIq9YTf4jlVCKBKn44m4yJvj94C7pTOyaa4VjZFohNqD"; - root_game-laptop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJUKHZasYQUAmRBiqtx1drDxfq18/N4rKydCtPHx461I"; + root_game-desktop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJUKHZasYQUAmRBiqtx1drDxfq18/N4rKydCtPHx461I"; root_gerg-desktop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIeHsGcmOdIMzV+SNe4WFcA3CPHCNb1aqxThkXtm7G/1"; gerg-desktop_fingerprint = "BQxvBOWsTw1gdNDR0KzrSRmbVhDrJdG05vYXkVmw8yA"; gerg_gerg-desktop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJWbwkFJmRBgyWyWU+w3ksZ+KuFw9uXJN3PwqqE7Z/i8"; diff --git a/modules/systemd-boot/default.nix b/modules/systemd-boot/default.nix index 0573053..7f1921d 100644 --- a/modules/systemd-boot/default.nix +++ b/modules/systemd-boot/default.nix @@ -101,8 +101,7 @@ let if cfg.mirroredBoots != [ ] then cfg.mirroredBoots else - [ efi.efiSysMountPoint ] - ; + [ efi.efiSysMountPoint ]; in pkgs.writeShellScript "install-systemd-boot.sh" ( lib.concatMapStrings @@ -111,8 +110,7 @@ let '') installDirs ) - + cfg.extraInstallCommands - ; + + cfg.extraInstallCommands; in { disabledModules = [ @@ -324,12 +322,14 @@ in config = mkIf cfg.enable { assertions = - [ { - assertion = - (config.boot.kernelPackages.kernel.features or { efiBootStub = true; }) - ? efiBootStub; - message = "This kernel does not support the EFI boot stub"; - } ] + [ + { + assertion = + (config.boot.kernelPackages.kernel.features or { efiBootStub = true; }) + ? efiBootStub; + message = "This kernel does not support the EFI boot stub"; + } + ] ++ concatMap (filename: [ { @@ -368,8 +368,7 @@ in } is invalid: files cannot be placed in the nixos/.extra-files directory"; } ]) - (builtins.attrNames cfg.extraFiles) - ; + (builtins.attrNames cfg.extraFiles); boot.loader.grub.enable = mkDefault false; diff --git a/modules/theming.nix b/modules/theming.nix index 591224a..8aaa581 100644 --- a/modules/theming.nix +++ b/modules/theming.nix @@ -82,10 +82,12 @@ in extraConfig = '' font-size=10 ''; - fonts = [ { - name = "OverpassMono"; - package = pkgs.nerdfonts.override { fonts = [ "Overpass" ]; }; - } ]; + fonts = [ + { + name = "OverpassMono"; + package = pkgs.nerdfonts.override { fonts = [ "Overpass" ]; }; + } + ]; }; systemd.services = { "autovt@tty1".enable = false;