Skip to content

Commit cddc1fc

Browse files
committed
modules: move nixos defaults module to modules file
1 parent 311b7f9 commit cddc1fc

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

src/mkFlake/fup-adapter.nix

+1-5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ let
6969
specialArgs = config.nixos.importables // { inherit (config) self inputs; };
7070

7171
modules = config.nixos.hostDefaults.exportedModules ++ defaultHostModules ++ [
72-
({ config, pkgs, self, ... }: {
73-
users.mutableUsers = lib.mkDefault false;
74-
hardware.enableRedistributableFirmware = lib.mkDefault true;
75-
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
76-
})
72+
internal-modules.nixosDefaults
7773
];
7874
}
7975
(stripNull config.nixos.hostDefaults);

src/modules.nix

+21-15
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@
2929
lib.mkDefault builds;
3030
};
3131

32-
hmNixosDefaults = { specialArgs, modules }:
33-
{ options, ... }: {
34-
config = lib.optionalAttrs (options ? home-manager) {
35-
home-manager = {
36-
# always use the system nixpkgs from the host's channel
37-
useGlobalPkgs = true;
38-
# and use the possible future default (see manual)
39-
useUserPackages = lib.mkDefault true;
40-
41-
extraSpecialArgs = specialArgs;
42-
sharedModules = modules;
43-
};
44-
};
45-
};
46-
4732
globalDefaults = { hmUsers }:
4833
{ config, pkgs, self, ... }: {
4934
# digga lib can be accessed in modules directly as config.lib.digga
@@ -59,4 +44,25 @@
5944
'';
6045
};
6146
};
47+
48+
nixosDefaults = { self, ... }: {
49+
users.mutableUsers = lib.mkDefault false;
50+
hardware.enableRedistributableFirmware = lib.mkDefault true;
51+
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
52+
};
53+
54+
hmNixosDefaults = { specialArgs, modules }:
55+
{ options, ... }: {
56+
config = lib.optionalAttrs (options ? home-manager) {
57+
home-manager = {
58+
# always use the system nixpkgs from the host's channel
59+
useGlobalPkgs = true;
60+
# and use the possible future default (see manual)
61+
useUserPackages = lib.mkDefault true;
62+
63+
extraSpecialArgs = specialArgs;
64+
sharedModules = modules;
65+
};
66+
};
67+
};
6268
}

0 commit comments

Comments
 (0)