Skip to content

Commit b1fade4

Browse files
committed
Remove customBuilds, nixos-generate has --flake
1 parent 94d5103 commit b1fade4

File tree

7 files changed

+63
-40
lines changed

7 files changed

+63
-40
lines changed

examples/devos/flake.lock

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

examples/devos/flake.nix

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
naersk.inputs.nixpkgs.follows = "nixos";
4040

4141
nixos-hardware.url = "github:nixos/nixos-hardware";
42+
43+
nixos-generators.url = "github:nix-community/nixos-generators";
4244
};
4345

4446
outputs =

examples/devos/shell/devos.nix

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ in
4545
(docs mdbook)
4646
(devos inputs.deploy.packages.${pkgs.system}.deploy-rs)
4747
]
48-
4948
++ lib.optional
5049
(system != "i686-linux")
5150
(devos cachix)
52-
51+
++ lib.optional
52+
(system != "aarch64-darwin")
53+
(devos inputs.nixos-generators.defaultPackage.${pkgs.system})
5354
;
5455
}

flake.lock

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

flake.nix

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949

5050
internal-modules = import ./src/modules.nix {
5151
inherit (nixlib) lib;
52-
inherit nixos-generators;
5352
};
5453

5554
importers = import ./src/importers.nix {

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)