From dbae17bd4634ca38e82561af068d6c7592c78f57 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Sun, 3 Mar 2024 22:13:09 -0600 Subject: [PATCH 1/4] first pass at reorg --- flake.nix | 148 +++++++++++++------------------------- hosts/ace/default.nix | 5 ++ hosts/display/default.nix | 3 + hosts/dragon/default.nix | 11 ++- hosts/eve/default.nix | 5 ++ hosts/fred/default.nix | 1 + hosts/harper/default.nix | 3 + hosts/harper2/default.nix | 3 + hosts/loki/default.nix | 5 ++ hosts/nuwww/default.nix | 3 + hosts/pihole/default.nix | 3 + hosts/pocket2/default.nix | 11 ++- hosts/smaug/default.nix | 5 ++ hosts/t2/default.nix | 5 ++ hosts/vm1/default.nix | 1 + hosts/www2/default.nix | 3 + wm/default.nix | 4 ++ 17 files changed, 120 insertions(+), 99 deletions(-) create mode 100644 wm/default.nix diff --git a/flake.nix b/flake.nix index a1db794..635a44a 100644 --- a/flake.nix +++ b/flake.nix @@ -17,108 +17,62 @@ self, nixpkgs, nix, + disko, nixos-hardware, home-manager, wayland-pipewire-idle-inhibit, ... - }: { - nixosConfigurations = let - workstation = { - system = "x86_64-linux"; - modules = [ - ./workstation - inputs.home-manager.nixosModules.home-manager - ./home - ./home/gui - ./wm/sway - ]; - }; - server = { - system = "x86_64-linux"; - modules = [ - ./server - inputs.home-manager.nixosModules.home-manager - ./home - ]; - }; + }: + let + inputs = { inherit disko home-manager nixpkgs nixos-hardware wayland-pipewire-idle-inhibit; }; + + genPkgs = system: import nixpkgs { inherit system; config.allowUnfree = true; }; + + # creates a nixos system config + nixosSystem = system: hostname: username: + let + pkgs = genPkgs system; + in + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit pkgs; + # lets us use these things in modules + customArgs = { inherit system hostname username pkgs; }; + }; + modules = [ + #disko.nixosModules.disko + ./hosts/${hostname} + home-manager.nixosModules.home-manager { + networking.hostName = hostname; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + #home-manager.users.${username} = { imports = [ ./home/${username}.nix ]; }; + } + ]; + }; in { - fred = inputs.nixpkgs.lib.nixosSystem { - modules = server.modules ++ [ - { - networking.hostName = "fred"; - } - ./hosts/fred - ]; - }; - www2 = inputs.nixpkgs.lib.nixosSystem { - modules = server.modules ++ [ - { - networking.hostName = "www2"; - } - ./hosts/fred - ]; - }; - loki = inputs.nixpkgs.lib.nixosSystem { - modules = workstation.modules ++ [ - { - networking.hostName = "loki"; - } - ./hosts/loki - inputs.nixos-hardware.nixosModules.dell-xps-13-9310 - ]; - }; - smaug = inputs.nixpkgs.lib.nixosSystem { - modules = workstation.modules ++ [ - { - networking.hostName = "smaug"; - } - ./hosts/smaug - ./hosts/smaug/podman.nix - inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x260 - ]; - }; - pocket2 = inputs.nixpkgs.lib.nixosSystem { - modules = workstation.modules ++ [ - { - networking.hostName = "pocket2"; - } - ./hosts/pocket2 - inputs.nixos-hardware.nixosModules.common-cpu-intel - inputs.nixos-hardware.nixosModules.common-gpu-intel - inputs.nixos-hardware.nixosModules.common-pc-laptop - inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd - ]; - }; - dragon = inputs.nixpkgs.lib.nixosSystem { - modules = workstation.modules ++ [ - { - networking.hostName = "dragon"; - } - ./hosts/dragon - inputs.nixos-hardware.nixosModules.common-cpu-intel - inputs.nixos-hardware.nixosModules.common-gpu-intel - inputs.nixos-hardware.nixosModules.common-pc-laptop - inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd - ]; - }; - eve = inputs.nixpkgs.lib.nixosSystem { - modules = workstation.modules ++ [ - { - networking.hostName = "eve"; - } - ./hosts/eve - inputs.nixos-hardware.nixosModules.google-pixelbook - ]; - }; - vm2 = inputs.nixpkgs.lib.nixosSystem { - modules = workstation.modules ++ [ - { - services.getty.autologinUser = "don"; - networking.hostName = "vm2"; - } - ./hosts/vm1 - ]; + nixosConfigurations = { + # clients + ace = nixosSystem "x86_64-linux" "ace" "don"; + dragon = nixosSystem "x86_64-linux" "dragon" "don"; + eve = nixosSystem "x86_64-linux" "eve" "don"; + loki = nixosSystem "x86_64-linux" "loki" "don"; + pocket2 = nixosSystem "x86_64-linux" "pocket2" "don"; + smaug = nixosSystem "x86_64-linux" "smaug" "don"; + #t2 = nixosSystem "x86_64-linux" "t2" "don"; + + # servers + display = nixosSystem "x86_64-linux" "display" "don"; + harper2 = nixosSystem "x86_64-linux" "harper2" "don"; + harper = nixosSystem "x86_64-linux" "harper" "don"; + nuwww = nixosSystem "x86_64-linux" "nuwww" "don"; + pihole = nixosSystem "x86_64-linux" "pihole" "don"; + www2 = nixosSystem "x86_64-linux" "www2" "don"; + + # test system + # use this for a blank ISO + disko to work + nixos = nixosSystem "x86_64-linux" "nixos" "don"; }; }; - }; } diff --git a/hosts/ace/default.nix b/hosts/ace/default.nix index cb8ba8b..eaee1e9 100644 --- a/hosts/ace/default.nix +++ b/hosts/ace/default.nix @@ -4,5 +4,10 @@ imports = [ ./hardware-configuration.nix + ../../workstation + ../../home + ../../home/gui + ../../wm ]; + networking.hostName = "ace"; } diff --git a/hosts/display/default.nix b/hosts/display/default.nix index cb8ba8b..f0acbde 100644 --- a/hosts/display/default.nix +++ b/hosts/display/default.nix @@ -4,5 +4,8 @@ imports = [ ./hardware-configuration.nix + ../../server + ../../home ]; + networking.hostName = "display"; } diff --git a/hosts/dragon/default.nix b/hosts/dragon/default.nix index cb8ba8b..d4624cb 100644 --- a/hosts/dragon/default.nix +++ b/hosts/dragon/default.nix @@ -1,8 +1,17 @@ -{ config, pkgs, ... }: +{ inputs, config, pkgs, ... }: { imports = [ ./hardware-configuration.nix + #inputs.nixos-hardware.nixosModules.common-cpu-intel + #inputs.nixos-hardware.nixosModules.common-gpu-intel + #inputs.nixos-hardware.nixosModules.common-pc-laptop + #inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd + ../../workstation + ../../home + ../../home/gui + ../../wm ]; + networking.hostName = "dragon"; } diff --git a/hosts/eve/default.nix b/hosts/eve/default.nix index cb8ba8b..5a662bd 100644 --- a/hosts/eve/default.nix +++ b/hosts/eve/default.nix @@ -4,5 +4,10 @@ imports = [ ./hardware-configuration.nix + ../../workstation + ../../home + ../../home/gui + ../../wm ]; + networking.hostName = "eve"; } diff --git a/hosts/fred/default.nix b/hosts/fred/default.nix index 6d3aa57..3044397 100644 --- a/hosts/fred/default.nix +++ b/hosts/fred/default.nix @@ -6,4 +6,5 @@ ./hardware-configuration.nix ./podman.nix ]; + networking.hostName = "fred"; } diff --git a/hosts/harper/default.nix b/hosts/harper/default.nix index cb8ba8b..8cd08cc 100644 --- a/hosts/harper/default.nix +++ b/hosts/harper/default.nix @@ -4,5 +4,8 @@ imports = [ ./hardware-configuration.nix + ../../server + ../../home ]; + networking.hostName = "harper"; } diff --git a/hosts/harper2/default.nix b/hosts/harper2/default.nix index cb8ba8b..8286c1f 100644 --- a/hosts/harper2/default.nix +++ b/hosts/harper2/default.nix @@ -4,5 +4,8 @@ imports = [ ./hardware-configuration.nix + ../../server + ../../home ]; + networking.hostName = "harper2"; } diff --git a/hosts/loki/default.nix b/hosts/loki/default.nix index cb8ba8b..8e109ac 100644 --- a/hosts/loki/default.nix +++ b/hosts/loki/default.nix @@ -4,5 +4,10 @@ imports = [ ./hardware-configuration.nix + ../../workstation + ../../home + ../../home/gui + ../../wm ]; + networking.hostName = "loki"; } diff --git a/hosts/nuwww/default.nix b/hosts/nuwww/default.nix index cb8ba8b..3cc444f 100644 --- a/hosts/nuwww/default.nix +++ b/hosts/nuwww/default.nix @@ -4,5 +4,8 @@ imports = [ ./hardware-configuration.nix + ../../server + ../../home ]; + networking.hostName = "nuwww"; } diff --git a/hosts/pihole/default.nix b/hosts/pihole/default.nix index cb8ba8b..6bbd8e1 100644 --- a/hosts/pihole/default.nix +++ b/hosts/pihole/default.nix @@ -4,5 +4,8 @@ imports = [ ./hardware-configuration.nix + ../../server + ../../home ]; + networking.hostName = "pihole"; } diff --git a/hosts/pocket2/default.nix b/hosts/pocket2/default.nix index cb8ba8b..6e8eb1c 100644 --- a/hosts/pocket2/default.nix +++ b/hosts/pocket2/default.nix @@ -1,8 +1,17 @@ -{ config, pkgs, ... }: +{ inputs, config, pkgs, ... }: { imports = [ ./hardware-configuration.nix + #inputs.nixos-hardware.nixosModules.common-cpu-intel + #inputs.nixos-hardware.nixosModules.common-gpu-intel + #inputs.nixos-hardware.nixosModules.common-pc-laptop + #inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd + ../../workstation + ../../home + ../../home/gui + ../../wm ]; + networking.hostName = "pocket2"; } diff --git a/hosts/smaug/default.nix b/hosts/smaug/default.nix index cb8ba8b..d03e7aa 100644 --- a/hosts/smaug/default.nix +++ b/hosts/smaug/default.nix @@ -4,5 +4,10 @@ imports = [ ./hardware-configuration.nix + ../../workstation + ../../home + ../../home/gui + ../../wm ]; + networking.hostName = "smaug"; } diff --git a/hosts/t2/default.nix b/hosts/t2/default.nix index cb8ba8b..57bd63a 100644 --- a/hosts/t2/default.nix +++ b/hosts/t2/default.nix @@ -4,5 +4,10 @@ imports = [ ./hardware-configuration.nix + ../../workstation + ../../home + ../../home/gui + ../../wm ]; + networking.hostName = "t2"; } diff --git a/hosts/vm1/default.nix b/hosts/vm1/default.nix index cb8ba8b..a6042a8 100644 --- a/hosts/vm1/default.nix +++ b/hosts/vm1/default.nix @@ -5,4 +5,5 @@ [ ./hardware-configuration.nix ]; + networking.hostName = "vm1"; } diff --git a/hosts/www2/default.nix b/hosts/www2/default.nix index cb8ba8b..7568efe 100644 --- a/hosts/www2/default.nix +++ b/hosts/www2/default.nix @@ -4,5 +4,8 @@ imports = [ ./hardware-configuration.nix + ../../server + ../../home ]; + networking.hostName = "www2"; } diff --git a/wm/default.nix b/wm/default.nix new file mode 100644 index 0000000..980bcac --- /dev/null +++ b/wm/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: + { + imports = [ ./sway ]; + } From f8b4ff24b2a741732bbc054e56d493ea6a0abf29 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Wed, 13 Mar 2024 16:46:58 -0500 Subject: [PATCH 2/4] home/citrix | remove unneed dep --- home/gui/citrix.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/home/gui/citrix.nix b/home/gui/citrix.nix index cd8e84a..e7b5933 100644 --- a/home/gui/citrix.nix +++ b/home/gui/citrix.nix @@ -1,7 +1,6 @@ { config, pkgs, ... }: { home.packages = with pkgs; [ - opencv citrix_workspace ]; home.file."ICAClient" = { From 385be570aab2d850f6b87cb1557fb42223e20860 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Wed, 13 Mar 2024 16:47:14 -0500 Subject: [PATCH 3/4] gnupg option change --- server/default.nix | 2 +- workstation/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/default.nix b/server/default.nix index a85c7cd..27b0e03 100644 --- a/server/default.nix +++ b/server/default.nix @@ -154,7 +154,7 @@ in gnupg = { agent = { enable = true; - pinentryFlavor = "curses"; + #pinentryFlavor = "curses"; enableSSHSupport = true; }; }; diff --git a/workstation/default.nix b/workstation/default.nix index 8bf7e9f..371a987 100644 --- a/workstation/default.nix +++ b/workstation/default.nix @@ -246,7 +246,7 @@ in gnupg = { agent = { enable = true; - pinentryFlavor = "curses"; + #pinentryFlavor = "curses"; enableSSHSupport = true; }; }; From 574364f93a11e050518c23a010d365f159fe2575 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Wed, 13 Mar 2024 16:47:26 -0500 Subject: [PATCH 4/4] flake.lock update --- flake.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index 05dc188..cc5fff5 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1709286488, - "narHash": "sha256-RDpTZ72zLu05djvXRzK76Ysqp9zSdh84ax/edEaJucs=", + "lastModified": 1710169806, + "narHash": "sha256-HeWFrRuHpnAiPmIr26OKl2g142HuGerwoO/XtW53pcI=", "owner": "nix-community", "repo": "disko", - "rev": "bde7dd352c07d43bd5b8245e6c39074a391fdd46", + "rev": "fe064a639319ed61cdf12b8f6eded9523abcc498", "type": "github" }, "original": { @@ -59,11 +59,11 @@ ] }, "locked": { - "lastModified": 1709204054, - "narHash": "sha256-U1idK0JHs1XOfSI1APYuXi4AEADf+B+ZU4Wifc0pBHk=", + "lastModified": 1710164657, + "narHash": "sha256-l64+ZjaQAVkHDVaK0VHwtXBdjcBD6nLBD+p7IfyBp/w=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f3367769a93b226c467551315e9e270c3f78b15", + "rev": "017b12de5b899ef9b64e2c035ce257bfe95b8ae2", "type": "github" }, "original": { @@ -97,11 +97,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1709366352, - "narHash": "sha256-kO/iLDsoPVsk2L0lt3rzDaUgqysb9kX4vvvz3OZCuJU=", + "lastModified": 1710190312, + "narHash": "sha256-Q6Lf+e3PZAFq/XzZnYghTgxERcSQcGOdT4nMA0Pe4s0=", "owner": "NixOS", "repo": "nix", - "rev": "75101396dc9bcd121ac865fcfb2b81bebe386746", + "rev": "90e86bf6d3f0c031b8fa2f7e68ce8457d2601ea4", "type": "github" }, "original": { @@ -111,11 +111,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1709410583, - "narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=", + "lastModified": 1710123225, + "narHash": "sha256-j3oWlxRZxB7cFsgEntpH3rosjFHRkAo/dhX9H3OfxtY=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc", + "rev": "ad2fd7b978d5e462048729a6c635c45d3d33c9ba", "type": "github" }, "original": { @@ -127,11 +127,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1708815994, - "narHash": "sha256-hL7N/ut2Xu0NaDxDMsw2HagAjgDskToGiyZOWriiLYM=", + "lastModified": 1710097495, + "narHash": "sha256-B7Ea7q7hU7SE8wOPJ9oXEBjvB89yl2csaLjf5v/7jr8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9a9dae8f6319600fa9aebde37f340975cab4b8c0", + "rev": "d40e866b1f98698d454dad8f592fe7616ff705a4", "type": "github" }, "original": { @@ -193,11 +193,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", + "lastModified": 1709961763, + "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", + "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34", "type": "github" }, "original": {