feat(configs): Pass flake to nixosSystem and darwinSystem

This commit is contained in:
Mohammad Rafiq 2025-07-14 13:26:44 +08:00
parent 25cb9a6ff8
commit 16d4a9e9d1
No known key found for this signature in database

View file

@ -28,7 +28,10 @@ let
name: value: name: value:
if class == "nixos" then if class == "nixos" then
nixosSystem { nixosSystem {
specialArgs.hostName = name; specialArgs = {
inherit (config.flake) self;
hostName = name;
};
modules = [ modules = [
cfg.modules.nixos.default cfg.modules.nixos.default
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
@ -38,11 +41,15 @@ let
} }
else if class == "darwin" then else if class == "darwin" then
darwinSystem { darwinSystem {
specialArgs = { inherit (config.flake) self; }; specialArgs = {
inherit (config.flake) self;
hostName = name;
};
modules = [ modules = [
cfg.modules.darwin.default cfg.modules.darwin.default
inputs.home-manager.darwinModules.home-manager inputs.home-manager.darwinModules.home-manager
{ home-manager = globalCfg name value; } { home-manager = globalCfg name value; }
(value.extraCfg or { })
] ++ optional value.graphical cfg.modules.darwin.graphical; ] ++ optional value.graphical cfg.modules.darwin.graphical;
} }
else else