Skip to content

Commit 0bcf588

Browse files
Document the reject systems feature
1 parent f4bc6bf commit 0bcf588

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

doc/manual/source/language/advanced-attributes.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,18 @@ Derivations can declare some infrequently used optional attributes.
370370

371371
ensures that the derivation can only be built on a machine with the `kvm` feature.
372372

373+
- [`rejectSystemFeatures`]{#adv-attr-rejectSystemFeatures}\
374+
375+
If a derivation has the `rejectSystemFeatures` attribute, then Nix will only build it on a machine that does not have the corresponding features set in its [`system-features` configuration](@docroot@/command-ref/conf-file.md#conf-system-features).
376+
377+
For example, setting
378+
379+
```nix
380+
rejectSystemFeatures = [ "pages-16k" ];
381+
```
382+
383+
ensures that the derivation can only be built on a machine which does not have the `pages-16k` feature.
384+
373385
[xp-feature-ca-derivations]: @docroot@/development/experimental-features.md#xp-feature-ca-derivations
374386
[xp-feature-dynamic-derivations]: @docroot@/development/experimental-features.md#xp-feature-dynamic-derivations
375387
[xp-feature-git-hashing]: @docroot@/development/experimental-features.md#xp-feature-git-hashing

src/libstore/globals.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public:
304304
305305
6. A comma-separated list of supported [system features](#conf-system-features).
306306
307-
A machine will only be used to build a derivation if all the features in the derivation's [`requiredSystemFeatures`](@docroot@/language/advanced-attributes.html#adv-attr-requiredSystemFeatures) attribute are supported by that machine.
307+
A machine will only be used to build a derivation if all the features in the derivation's [`requiredSystemFeatures`](@docroot@/language/advanced-attributes.html#adv-attr-requiredSystemFeatures) attribute are supported by that machine and does not have any features in [`rejectSystemFeatures`](@docroot@/language/advanced-attributes.html#adv-attr-rejectSystemFeatures).
308308
309309
7. A comma-separated list of required [system features](#conf-system-features).
310310

0 commit comments

Comments
 (0)