Skip to content

Commit 2f6bcd3

Browse files
committed
Remove customBuilds, nixos-generate has --flake
1 parent 396b04b commit 2f6bcd3

File tree

4 files changed

+8
-37
lines changed

4 files changed

+8
-37
lines changed

examples/devos/shell/devos.nix

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ in
4444
# (docs python3Packages.grip) too many deps
4545
(docs mdbook)
4646
(devos inputs.deploy.packages.${pkgs.system}.deploy-rs)
47+
(devos inputs.nixos-generators.${pkgs.system}.defaultPackage)
4748
]
4849

4950
++ lib.optional

flake.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/mkFlake/fup-adapter.nix

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ let
3939
''
4040
{ });
4141
})
42-
internal-modules.customBuilds
4342
];
4443

4544
unifyOverlays = channels: map (o: if builtins.isFunction (o null null) then o channels else o);

src/modules.nix

+1-30
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
1-
{ lib, nixos-generators }:
1+
{ lib }:
22
{
3-
customBuilds =
4-
{ lib, pkgs, config, baseModules, modules, ... }@args:
5-
{
6-
# created in modules system for access to specialArgs and modules
7-
lib.digga.mkBuild = buildModule:
8-
import "${toString pkgs.path}/nixos/lib/eval-config.nix" {
9-
inherit (pkgs) system;
10-
inherit baseModules;
11-
modules = modules ++ [ buildModule ];
12-
# Newer versions of module system pass specialArgs to modules
13-
# so try to pass that to eval if possible.
14-
specialArgs = args.specialArgs or { };
15-
};
16-
system.build =
17-
let
18-
builds = lib.mapAttrs
19-
(format: module:
20-
let build = config.lib.digga.mkBuild module;
21-
in
22-
build // build.config.system.build.${build.config.formatAttr}
23-
)
24-
(if (lib.versionAtLeast config.system.stateVersion "22.05") then
25-
builtins.removeAttrs nixos-generators.nixosModules [ "vm" ]
26-
else nixos-generators);
27-
in
28-
# ensure these builds can be overriden by other modules
29-
lib.mkDefault builds;
30-
};
31-
323
hmNixosDefaults = { specialArgs, modules }:
334
{ options, ... }: {
345
config = lib.optionalAttrs (options ? home-manager) {

0 commit comments

Comments
 (0)