better machine conf, rework key/machines management
This commit is contained in:
15
flake.nix
15
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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user