diff options
| author | andromeda <andromeda@lenovo> | 2025-12-31 01:14:37 +0100 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2025-12-31 01:14:37 +0100 |
| commit | 42a93f042e2c821939fa6aa4ac8945997d5b5099 (patch) | |
| tree | bcc6ec5399cdabd28c9e30faca59d6bea925e7d4 /flake.nix | |
| parent | 07655e513522db296b1032290c7cfb6a5ac64181 (diff) | |
better machine conf, rework key/machines management
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -38,8 +38,8 @@ stylix, ... }: let - laptop = import ./machines/laptop/machine.nix; - _173-249-5-230 = import ./machines/173-249-5-230/machine.nix; + machines = import ./machines.nix; + _173-249-5-230 = machines._173-249-5-230; configuration = machine: modules: nixpkgs.lib.nixosSystem { system = machine.system; @@ -47,8 +47,7 @@ modules = modules ++ [ - machine.configuration - machine.hardware-configuration + ./machines/${machine.hostname}/configuration.nix ]; }; configurationWithHomeManager = machine: (configuration machine @@ -67,7 +66,7 @@ (name: value: value) ( nixpkgs.legacyPackages.${machine.system}.lib.genAttrs - machine.usernames + machine.users ( name: { imports = [ @@ -84,7 +83,9 @@ noshell.nixosModules.default ]); in { - nixosConfigurations.${laptop.hostname} = configurationWithHomeManager laptop; - nixosConfigurations.${_173-249-5-230.hostname} = configurationWithHomeManager _173-249-5-230; + nixosConfigurations = + builtins.mapAttrs + (hostname: value: configurationWithHomeManager value) + machines; }; } |
