diff options
| -rw-r--r-- | flake.lock | 6 | ||||
| -rw-r--r-- | flake.nix | 9 | ||||
| -rw-r--r-- | hosts/_turret/default.nix (renamed from hosts/turret/default.nix) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/dhcp (renamed from hosts/turret/files/etc/config/dhcp) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/dropbear (renamed from hosts/turret/files/etc/config/dropbear) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/firewall (renamed from hosts/turret/files/etc/config/firewall) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/https-dns-proxy (renamed from hosts/turret/files/etc/config/https-dns-proxy) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/luci (renamed from hosts/turret/files/etc/config/luci) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/network (renamed from hosts/turret/files/etc/config/network) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/rpcd (renamed from hosts/turret/files/etc/config/rpcd) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/system (renamed from hosts/turret/files/etc/config/system) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/ucitrack (renamed from hosts/turret/files/etc/config/ucitrack) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/uhttpd (renamed from hosts/turret/files/etc/config/uhttpd) | 0 | ||||
| -rw-r--r-- | hosts/_turret/files/etc/config/wireless (renamed from hosts/turret/files/etc/config/wireless) | bin | 827 -> 827 bytes | |||
| -rw-r--r-- | hosts/_turret/files/etc/dropbear/authorized_keys (renamed from hosts/turret/files/etc/dropbear/authorized_keys) | 0 | ||||
| -rw-r--r-- | hosts/default.nix | 31 | ||||
| -rw-r--r-- | hosts/glados-wsl/default.nix | 3 | ||||
| -rw-r--r-- | hosts/glados/default.nix | 10 | ||||
| -rw-r--r-- | lib/default.nix | 16 | ||||
| -rw-r--r-- | lib/host.nix | 44 | ||||
| -rw-r--r-- | lib/user.nix | 35 | ||||
| -rw-r--r-- | users/_secrets/rootPassword.age (renamed from users/secrets/rootPassword.age) | bin | 365 -> 365 bytes | |||
| -rw-r--r-- | users/_secrets/secrets.nix (renamed from users/secrets/secrets.nix) | 0 | ||||
| -rw-r--r-- | users/_secrets/sethPassword.age (renamed from users/secrets/sethPassword.age) | 0 | ||||
| -rw-r--r-- | users/default.nix | 6 | ||||
| -rw-r--r-- | users/seth/home.nix | 8 |
26 files changed, 51 insertions, 117 deletions
@@ -151,11 +151,11 @@ ] }, "locked": { - "lastModified": 1681774655, - "narHash": "sha256-FutQ3V1KMuySMeGbxKeCQ6i3b4FZ7WbKJLRTbp/u+JU=", + "lastModified": 1682040726, + "narHash": "sha256-0wnUd7rCeANBvLOhawNhZxB0wW146q2GrfVkbHpbi70=", "owner": "getchoo", "repo": "overlay", - "rev": "76817703bb1cf925e6f99a2ba8ad78d2ec560b6e", + "rev": "5e476304b0ec6109cb9d09a89872a6b9a138efbf", "type": "github" }, "original": { @@ -68,12 +68,15 @@ self, nixpkgs, agenix, + getchoo, flake-utils, openwrt-imagebuilder, pre-commit-hooks, ... }: let - inherit (import ./lib {inherit (nixpkgs) lib;}) mapHosts mapHMUsers; + getchooLib = getchoo.lib (inputs // {inherit self;}); + + inherit (getchooLib.configs) mapHMUsers mapHosts; in flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; @@ -110,10 +113,10 @@ formatter = pkgs.alejandra; - homeConfigurations = mapHMUsers inputs system; + homeConfigurations = mapHMUsers system ./users; }) // { - nixosConfigurations = mapHosts inputs; + nixosConfigurations = mapHosts ./hosts; nixosModules.getchoo = import ./modules; diff --git a/hosts/turret/default.nix b/hosts/_turret/default.nix index faac3d2..faac3d2 100644 --- a/hosts/turret/default.nix +++ b/hosts/_turret/default.nix diff --git a/hosts/turret/files/etc/config/dhcp b/hosts/_turret/files/etc/config/dhcp index 4a471cf..4a471cf 100644 --- a/hosts/turret/files/etc/config/dhcp +++ b/hosts/_turret/files/etc/config/dhcp diff --git a/hosts/turret/files/etc/config/dropbear b/hosts/_turret/files/etc/config/dropbear index 2139ba0..2139ba0 100644 --- a/hosts/turret/files/etc/config/dropbear +++ b/hosts/_turret/files/etc/config/dropbear diff --git a/hosts/turret/files/etc/config/firewall b/hosts/_turret/files/etc/config/firewall index b9a4647..b9a4647 100644 --- a/hosts/turret/files/etc/config/firewall +++ b/hosts/_turret/files/etc/config/firewall diff --git a/hosts/turret/files/etc/config/https-dns-proxy b/hosts/_turret/files/etc/config/https-dns-proxy index e5623ad..e5623ad 100644 --- a/hosts/turret/files/etc/config/https-dns-proxy +++ b/hosts/_turret/files/etc/config/https-dns-proxy diff --git a/hosts/turret/files/etc/config/luci b/hosts/_turret/files/etc/config/luci index 8eb8a9b..8eb8a9b 100644 --- a/hosts/turret/files/etc/config/luci +++ b/hosts/_turret/files/etc/config/luci diff --git a/hosts/turret/files/etc/config/network b/hosts/_turret/files/etc/config/network index c71cf98..c71cf98 100644 --- a/hosts/turret/files/etc/config/network +++ b/hosts/_turret/files/etc/config/network diff --git a/hosts/turret/files/etc/config/rpcd b/hosts/_turret/files/etc/config/rpcd index 176c643..176c643 100644 --- a/hosts/turret/files/etc/config/rpcd +++ b/hosts/_turret/files/etc/config/rpcd diff --git a/hosts/turret/files/etc/config/system b/hosts/_turret/files/etc/config/system index ee3415f..ee3415f 100644 --- a/hosts/turret/files/etc/config/system +++ b/hosts/_turret/files/etc/config/system diff --git a/hosts/turret/files/etc/config/ucitrack b/hosts/_turret/files/etc/config/ucitrack index bb4cdbc..bb4cdbc 100644 --- a/hosts/turret/files/etc/config/ucitrack +++ b/hosts/_turret/files/etc/config/ucitrack diff --git a/hosts/turret/files/etc/config/uhttpd b/hosts/_turret/files/etc/config/uhttpd index cb2ff71..cb2ff71 100644 --- a/hosts/turret/files/etc/config/uhttpd +++ b/hosts/_turret/files/etc/config/uhttpd diff --git a/hosts/turret/files/etc/config/wireless b/hosts/_turret/files/etc/config/wireless Binary files differindex b4a431d..b4a431d 100644 --- a/hosts/turret/files/etc/config/wireless +++ b/hosts/_turret/files/etc/config/wireless diff --git a/hosts/turret/files/etc/dropbear/authorized_keys b/hosts/_turret/files/etc/dropbear/authorized_keys index 495c605..495c605 100644 --- a/hosts/turret/files/etc/dropbear/authorized_keys +++ b/hosts/_turret/files/etc/dropbear/authorized_keys diff --git a/hosts/default.nix b/hosts/default.nix index fdaea60..e9396a1 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,26 +1,42 @@ inputs: with inputs; let - common = { + common = rec { system = "x86_64-linux"; - stateVersion = "23.05"; - pkgs = nixpkgsUnstable; - modules = with inputs; [ + builder = nixpkgsUnstable.lib.nixosSystem; + + modules = [ agenix.nixosModules.default home-manager.nixosModules.home-manager nur.nixosModules.nur + + self.nixosModules.getchoo + "${self}/users/seth" + { age = { identityPaths = ["/etc/age/key"]; secrets = { - rootPassword.file = ../users/secrets/rootPassword.age; - sethPassword.file = ../users/secrets/sethPassword.age; + rootPassword.file = "${self}/users/_secrets/rootPassword.age"; + sethPassword.file = "${self}/users/_secrets/sethPassword.age"; }; }; + + nixpkgs = { + overlays = [nur.overlay getchoo.overlays.default]; + config.allowUnfree = true; + }; + + nix.registry.getchoo.flake = getchoo; + nixos.enable = true; + system.stateVersion = "23.05"; } ]; + + specialArgs = {}; }; in { glados = { + inherit (common) builder specialArgs system; modules = common.modules ++ [ @@ -29,14 +45,13 @@ in { nixos-hardware.nixosModules.common-pc-ssd lanzaboote.nixosModules.lanzaboote ]; - inherit (common) system stateVersion pkgs; }; glados-wsl = { + inherit (common) builder specialArgs system; modules = common.modules ++ [ nixos-wsl.nixosModules.wsl ]; - inherit (common) system stateVersion pkgs; }; } diff --git a/hosts/glados-wsl/default.nix b/hosts/glados-wsl/default.nix index 4ba8485..25aaf5e 100644 --- a/hosts/glados-wsl/default.nix +++ b/hosts/glados-wsl/default.nix @@ -5,7 +5,6 @@ }: { imports = [ (modulesPath + "/profiles/minimal.nix") - ../../users/seth ]; environment.systemPackages = with pkgs; [ @@ -31,6 +30,8 @@ nixos.networking.enable = false; + networking.hostName = "glados-wsl"; + security = { apparmor.enable = false; audit.enable = false; diff --git a/hosts/glados/default.nix b/hosts/glados/default.nix index a2be3f5..62006b3 100644 --- a/hosts/glados/default.nix +++ b/hosts/glados/default.nix @@ -1,6 +1,9 @@ -{home-manager, ...}: { +{ + home-manager, + self, + ... +}: { imports = [ - ../../users/seth ./boot.nix ./hardware-configuration.nix ]; @@ -15,7 +18,7 @@ home-manager.users.seth = { imports = [ - ../../users/seth/desktop + "${self}/users/seth/desktop" ]; desktop.gnome.enable = true; @@ -25,6 +28,7 @@ LIBVA_DRIVER_NAME=vdpau ''; + networking.hostName = "glados"; powerManagement.cpuFreqGovernor = "ondemand"; security.tpm2 = { diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index 94acb96..0000000 --- a/lib/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{lib}: let - inherit (builtins) readDir; - inherit (lib) filterAttrs mapAttrs; - - my = { - mapFilterDirs = dir: filter: map: let - dirs = filterAttrs filter (readDir dir); - in - mapAttrs map dirs; - }; - - myLib = lib.extend (_: _: {inherit my;}); - common = {lib = myLib;}; -in - (import ./host.nix common) - // (import ./user.nix common) diff --git a/lib/host.nix b/lib/host.nix deleted file mode 100644 index 5b092b4..0000000 --- a/lib/host.nix +++ /dev/null @@ -1,44 +0,0 @@ -{lib}: rec { - mkHost = { - name, - modules, - specialArgs ? {}, - system ? "x86_64-linux", - stateVersion ? "22.11", - pkgs, - inputs, - }: - with pkgs.lib; - nixosSystem { - inherit system specialArgs; - modules = - [ - ../modules - ../hosts/${name} - - { - system.stateVersion = stateVersion; - networking.hostName = mkDefault name; - - nixpkgs = { - overlays = with inputs; [nur.overlay getchoo.overlays.default]; - config.allowUnfree = true; - }; - nix.registry.getchoo.flake = inputs.getchoo; - - nixos.enable = true; - } - ] - ++ modules; - }; - - mapHosts = inputs: let - hosts = import ../hosts inputs; - inherit (lib.my) mapFilterDirs; - in - mapFilterDirs ../hosts (n: v: v == "directory" && n != "turret") (name: _: - mkHost ({ - inherit name inputs; - } - // hosts.${name})); -} diff --git a/lib/user.nix b/lib/user.nix deleted file mode 100644 index 88e466f..0000000 --- a/lib/user.nix +++ /dev/null @@ -1,35 +0,0 @@ -{lib}: rec { - mkHMUser = { - username, - pkgs, - stateVersion ? "22.11", - modules ? [], - inputs, - }: - inputs.home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = - [ - ../users/${username}/home.nix - { - home = { - inherit username stateVersion; - homeDirectory = "/home/${username}"; - }; - - programs.home-manager.enable = true; - } - ] - ++ modules; - }; - - mapHMUsers = inputs: system: let - users = import ../users inputs system; - inherit (lib.my) mapFilterDirs; - in - mapFilterDirs ../users (n: v: v == "directory" && n != "secrets") (username: _: - mkHMUser ({ - inherit username inputs; - } - // users.${username})); -} diff --git a/users/secrets/rootPassword.age b/users/_secrets/rootPassword.age Binary files differindex 7a2ede3..7a2ede3 100644 --- a/users/secrets/rootPassword.age +++ b/users/_secrets/rootPassword.age diff --git a/users/secrets/secrets.nix b/users/_secrets/secrets.nix index c85e64a..c85e64a 100644 --- a/users/secrets/secrets.nix +++ b/users/_secrets/secrets.nix diff --git a/users/secrets/sethPassword.age b/users/_secrets/sethPassword.age index 43040ff..43040ff 100644 --- a/users/secrets/sethPassword.age +++ b/users/_secrets/sethPassword.age diff --git a/users/default.nix b/users/default.nix index 964fc3d..3fe9d4a 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1,11 +1,11 @@ -inputs: system: +system: inputs: with inputs; { seth = { pkgs = import nixpkgsUnstable { inherit system; overlays = [nur.overlay getchoo.overlays.default]; }; - - stateVersion = "23.05"; + modules = []; + extraSpecialArgs = {}; }; } diff --git a/users/seth/home.nix b/users/seth/home.nix index 239782e..a10f061 100644 --- a/users/seth/home.nix +++ b/users/seth/home.nix @@ -8,7 +8,14 @@ ./shell ]; + home = { + username = "seth"; + homeDirectory = "/home/seth"; + stateVersion = "23.05"; + }; + nix.package = lib.mkDefault pkgs.nixFlakes; + xdg = { enable = true; configFile."nixpkgs/config.nix".text = '' @@ -18,5 +25,4 @@ } ''; }; - home.stateVersion = "23.05"; } |
