mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03: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
2 changed files with 19 additions and 9 deletions
|
@ -139,21 +139,13 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../build.nix
|
||||||
(mkRemovedOptionModule [ "nesting" "clone" ] "Use `specialisation.«name» = { inheritParentConfig = true; configuration = { ... }; }` instead.")
|
(mkRemovedOptionModule [ "nesting" "clone" ] "Use `specialisation.«name» = { inheritParentConfig = true; configuration = { ... }; }` instead.")
|
||||||
(mkRemovedOptionModule [ "nesting" "children" ] "Use `specialisation.«name».configuration = { ... }` instead.")
|
(mkRemovedOptionModule [ "nesting" "children" ] "Use `specialisation.«name».configuration = { ... }` instead.")
|
||||||
];
|
];
|
||||||
|
|
||||||
options = {
|
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 {
|
specialisation = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
example = lib.literalExpression "{ fewJobsManyCores.configuration = { nix.buildCores = 0; nix.maxJobs = 1; }; }";
|
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…
Add table
Add a link
Reference in a new issue