From 42a93f042e2c821939fa6aa4ac8945997d5b5099 Mon Sep 17 00:00:00 2001 From: andromeda Date: Wed, 31 Dec 2025 01:14:37 +0100 Subject: better machine conf, rework key/machines management --- flake.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'flake.nix') 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; }; } -- cgit v1.3