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.
This commit is contained in:
Robert Hensing 2022-01-20 14:53:35 +01:00
parent badf5a0dc4
commit 3ac955acf4
2 changed files with 19 additions and 9 deletions

View file

@ -139,21 +139,13 @@ in
{
imports = [
../build.nix
(mkRemovedOptionModule [ "nesting" "clone" ] "Use `specialisation.«name» = { inheritParentConfig = true; configuration = { ... }; }` instead.")
(mkRemovedOptionModule [ "nesting" "children" ] "Use `specialisation.«name».configuration = { ... }` instead.")
];
options = {
system.build = mkOption {
internal = true;
default = {};
type = with types; lazyAttrsOf (uniq unspecified);
description = ''
Attribute set of derivations used to setup the system.
'';
};
specialisation = mkOption {
default = {};
example = lib.literalExpression "{ fewJobsManyCores.configuration = { nix.buildCores = 0; nix.maxJobs = 1; }; }";

View file

@ -0,0 +1,18 @@
{ lib, ... }:
let
inherit (lib) mkOption types;
in
{
options = {
system.build = mkOption {
internal = true;
default = {};
type = with types; lazyAttrsOf (uniq unspecified);
description = ''
Attribute set of derivations used to set up the system.
'';
};
};
}