diff options
| -rw-r--r-- | flake.nix | 84 | ||||
| -rwxr-xr-x | rebuild | 2 |
2 files changed, 47 insertions, 39 deletions
@@ -18,44 +18,48 @@ rec { }; }; - outputs = { nixpkgs, ... }@inputs : - let - system = "x86_64-linux"; - extLib = nixpkgs.lib.extend (final: prev: import ./lib); - mkNixosConfiguration = hostname: nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - inherit hostname; - lib = extLib; - }; - modules = [ - ./hosts/${hostname}/configuration.nix - ./hosts/${hostname}/hardware-configuration.nix - ./archetypes - ./nixos - ./pkgs - ./users - inputs.sops-nix.nixosModules.sops - inputs.home-manager.nixosModules.home-manager { - home-manager = { - backupFileExtension = "backup"; # In case file is overwritten - useGlobalPkgs = true; - useUserPackages = true; - sharedModules = [ - inputs.arkenfox.hmModules.arkenfox - ./home-manager - ]; - }; - } - ]; + outputs = { nixpkgs, ... }@inputs: let + extLib = nixpkgs.lib.extend (final: prev: import ./lib); + mkNixosConfiguration = system: hostname: nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + inherit hostname; + lib = extLib; }; - in { - nixosConfigurations = builtins.listToAttrs (map (hostname: { - name = hostname; - value = mkNixosConfiguration hostname; - }) [ - # Configured system hostnames go here + modules = [ + ./hosts/${hostname}/configuration.nix + ./hosts/${hostname}/hardware-configuration.nix + ./archetypes + ./nixos + ./pkgs + ./users + inputs.sops-nix.nixosModules.sops + inputs.home-manager.nixosModules.home-manager { + home-manager = { + backupFileExtension = "backup"; # In case file is overwritten + useGlobalPkgs = true; + useUserPackages = true; + sharedModules = [ + inputs.arkenfox.hmModules.arkenfox + ./home-manager + ]; + }; + } + ]; + }; + mkNixosConfigurations = hostsBySystem: builtins.listToAttrs ( + builtins.concatMap (system: + map (host: { + name = host; + value = mkNixosConfiguration system host; + }) hostsBySystem.${system} + ) (builtins.attrNames hostsBySystem) + ); + in { + # Configured system hostnames go here under their respective system architecture + nixosConfigurations = mkNixosConfigurations { + x86_64-linux = [ "T495" "X230" "flex-wg-router" @@ -63,6 +67,10 @@ rec { "libreX60" "optiplex" "poweredge" - ]); + ]; + aarch64-linux = [ + "piframe" + ]; }; + }; } @@ -1,2 +1,2 @@ #!/bin/sh -nixos-rebuild switch --use-remote-sudo --flake "$(dirname "$0")/#$(hostname)" $@ +nixos-rebuild switch --sudo --flake "$(dirname "$0")/#$(hostname)" $@ |
