Skip to content

Commit 6740420

Browse files
authored
Merge pull request #436 from Pacman99/remove-customBuilds
Remove customBuilds, nixos-generate has --flake
2 parents 336235e + 51d8ca3 commit 6740420

7 files changed

Lines changed: 57 additions & 75 deletions

File tree

examples/devos/flake.lock

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/devos/flake.nix

Lines changed: 2 additions & 0 deletions
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

Lines changed: 3 additions & 2 deletions
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

Lines changed: 0 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
devshell.url = "github:numtide/devshell";
2222
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
2323

24-
nixos-generators.url = "github:nix-community/nixos-generators";
25-
nixos-generators.inputs.nixpkgs.follows = "blank";
26-
2724
flake-compat = {
2825
url = "github:edolstra/flake-compat";
2926
flake = false;
@@ -38,7 +35,6 @@
3835
, deploy
3936
, devshell
4037
, flake-utils-plus
41-
, nixos-generators
4238
, home-manager
4339
, ...
4440
}@inputs:
@@ -48,7 +44,6 @@
4844

4945
internal-modules = import ./src/modules.nix {
5046
inherit (nixlib) lib;
51-
inherit nixos-generators;
5247
};
5348

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

src/mkFlake/fup-adapter.nix

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 30 deletions
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)