mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
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:
parent
badf5a0dc4
commit
3ac955acf4
@ -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; }; }";
|
||||
|
18
nixos/modules/system/build.nix
Normal file
18
nixos/modules/system/build.nix
Normal 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.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user