mirror of
https://github.com/divnix/digga.git
synced 2024-12-23 08:02:21 +03:00
darwin: relocate nixos-only defs out of globalDefaults
module
most of the `globalDefaults` module's definitions are not present in nix-darwin, so they need to move into nixos-specific modules. at this time, darwin does not yet have its own host-type-specific defaults module, but there are probably some defs worth adding to such a module.
This commit is contained in:
parent
1c977a3cb5
commit
223920bf00
@ -64,9 +64,12 @@ let
|
||||
system = "x86_64-linux";
|
||||
output = "nixosConfigurations";
|
||||
|
||||
# add `self` & `inputs` as specialargs so their libs can be used in imports
|
||||
# add `self` & `inputs` as specialArgs so their libs can be used in imports
|
||||
specialArgs = config.nixos.importables // { inherit (config) self inputs; };
|
||||
modules = config.nixos.hostDefaults.exportedModules ++ defaultHostModules;
|
||||
|
||||
modules = config.nixos.hostDefaults.exportedModules ++ defaultHostModules ++ [
|
||||
internal-modules.nixosDefaults
|
||||
];
|
||||
}
|
||||
(stripNull config.nixos.hostDefaults);
|
||||
nixosHosts = lib.mapAttrs
|
||||
@ -84,7 +87,7 @@ let
|
||||
output = "darwinConfigurations";
|
||||
builder = darwin.lib.darwinSystem;
|
||||
|
||||
# add `self` & `inputs` as specialargs so their libs can be used in imports
|
||||
# add `self` & `inputs` as specialArgs so their libs can be used in imports
|
||||
specialArgs = config.darwin.importables // { inherit (config) self inputs; };
|
||||
modules = config.darwin.hostDefaults.exportedModules ++ defaultHostModules;
|
||||
}
|
||||
|
@ -17,10 +17,6 @@
|
||||
|
||||
globalDefaults = { hmUsers }:
|
||||
{ config, pkgs, self, ... }: {
|
||||
users.mutableUsers = lib.mkDefault false;
|
||||
|
||||
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
||||
|
||||
# digga lib can be accessed in modules directly as config.lib.digga
|
||||
lib = {
|
||||
inherit (pkgs.lib) digga;
|
||||
@ -33,7 +29,12 @@
|
||||
`self.nixosConfigurations`, with the `self` module argument.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
nixosDefaults = { self, ... }: {
|
||||
users.mutableUsers = lib.mkDefault false;
|
||||
hardware.enableRedistributableFirmware = lib.mkDefault true;
|
||||
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user