Skip to content

Commit 3ac955a

Browse files
committed
nixos/system/build: Extract
Modules that do not depend on e.g. toplevel should not have to include it just to set things in `system.build`. As a general rule, this keeps tests simple, usage flexible and evaluation fast. While one module is insignificant, consistency and good practices are.
1 parent badf5a0 commit 3ac955a

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

nixos/modules/system/activation/top-level.nix

+1-9
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,13 @@ in
139139

140140
{
141141
imports = [
142+
../build.nix
142143
(mkRemovedOptionModule [ "nesting" "clone" ] "Use `specialisation.«name» = { inheritParentConfig = true; configuration = { ... }; }` instead.")
143144
(mkRemovedOptionModule [ "nesting" "children" ] "Use `specialisation.«name».configuration = { ... }` instead.")
144145
];
145146

146147
options = {
147148

148-
system.build = mkOption {
149-
internal = true;
150-
default = {};
151-
type = with types; lazyAttrsOf (uniq unspecified);
152-
description = ''
153-
Attribute set of derivations used to setup the system.
154-
'';
155-
};
156-
157149
specialisation = mkOption {
158150
default = {};
159151
example = lib.literalExpression "{ fewJobsManyCores.configuration = { nix.buildCores = 0; nix.maxJobs = 1; }; }";

nixos/modules/system/build.nix

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{ lib, ... }:
2+
let
3+
inherit (lib) mkOption types;
4+
in
5+
{
6+
options = {
7+
8+
system.build = mkOption {
9+
internal = true;
10+
default = {};
11+
type = with types; lazyAttrsOf (uniq unspecified);
12+
description = ''
13+
Attribute set of derivations used to set up the system.
14+
'';
15+
};
16+
17+
};
18+
}

0 commit comments

Comments
 (0)