Refactor to pass host vars as arguments
Remove per‑host imports across flake, modules, and profiles, exposing needed variables (system, printer settings, consoleKeyMap, etc.) as arguments. Drop unused printEnable flags from host variable files.
This commit is contained in:
@@ -65,25 +65,14 @@
|
||||
hostDirs = builtins.attrNames (builtins.readDir ./hosts);
|
||||
|
||||
mkHost = hostName: let
|
||||
inherit
|
||||
(import ./hosts/${hostName}/variables.nix)
|
||||
host
|
||||
username
|
||||
profile
|
||||
system
|
||||
;
|
||||
hostVars = import ./hosts/${hostName}/variables.nix;
|
||||
hostPrinterVars = import ./hosts/${hostName}/printers.nix;
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit username;
|
||||
inherit host;
|
||||
inherit profile;
|
||||
inherit system;
|
||||
};
|
||||
inherit (hostVars) system;
|
||||
specialArgs = hostVars // hostPrinterVars // {inherit inputs;};
|
||||
modules = [
|
||||
./profiles/${profile}
|
||||
./profiles/${hostVars.profile}
|
||||
nix-flatpak.nixosModules.nix-flatpak
|
||||
garandos-tui.nixosModules.garandos-tui
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user