summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2025-12-31 01:14:37 +0100
committerandromeda <andromeda@lenovo>2025-12-31 01:14:37 +0100
commit42a93f042e2c821939fa6aa4ac8945997d5b5099 (patch)
treebcc6ec5399cdabd28c9e30faca59d6bea925e7d4 /flake.nix
parent07655e513522db296b1032290c7cfb6a5ac64181 (diff)
better machine conf, rework key/machines management
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix15
1 files changed, 8 insertions, 7 deletions
diff --git a/flake.nix b/flake.nix
index d8682d5..328aad5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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;
};
}