Skip to content

Commit 44b7866

Browse files
committed
Remove customBuilds, nixos-generate has --flake
nixos-generators added proper flake support and theres no need to add all the builds when nixos-generate as a command will add modules when necessary.
1 parent 8a77ad7 commit 44b7866

File tree

4 files changed

+1
-73
lines changed

4 files changed

+1
-73
lines changed

flake.lock

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

flake.nix

-5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020

2121
devshell.url = "github:numtide/devshell";
2222
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
23-
24-
nixos-generators.url = "github:nix-community/nixos-generators";
25-
nixos-generators.inputs.nixpkgs.follows = "blank";
2623
};
2724

2825
outputs =
@@ -33,7 +30,6 @@
3330
, deploy
3431
, devshell
3532
, flake-utils-plus
36-
, nixos-generators
3733
, home-manager
3834
, ...
3935
}@inputs:
@@ -43,7 +39,6 @@
4339

4440
internal-modules = import ./src/modules.nix {
4541
inherit (nixlib) lib;
46-
inherit nixos-generators;
4742
};
4843

4944
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)