lol

doc: move note on configuring Nixpkgs in NixOS to the NixOS manual (#304307)

that NixOS manual section talks a lot about Nixpkgs package
configuration, which really should not be there but rather in the
Nixpkgs manual itself. but this is a rabbit hole for another time.

Co-authored-by: Dominic Mills <dominic.millz27@gmail.com>

authored by

Valentin Gagarin
Dominic Mills
and committed by
GitHub
9b76c3bf 1a2d905c

+38 -21
+12 -17
doc/using/configuration.chapter.md
··· 1 1 # Global configuration {#chap-packageconfig} 2 2 3 - Nix comes with certain defaults about what packages can and cannot be installed, based on a package's metadata. By default, Nix will prevent installation if any of the following criteria are true: 3 + Nix comes with certain defaults about which packages can and cannot be installed, based on a package's metadata. 4 + By default, Nix will prevent installation if any of the following criteria are true: 4 5 5 6 - The package is thought to be broken, and has had its `meta.broken` set to `true`. 6 7 ··· 10 11 11 12 - The package has known security vulnerabilities but has not or can not be updated for some reason, and a list of issues has been entered in to the package's `meta.knownVulnerabilities`. 12 13 13 - Note that all this is checked during evaluation already, and the check includes any package that is evaluated. In particular, all build-time dependencies are checked. `nix-env -qa` will (attempt to) hide any packages that would be refused. 14 + Each of these criteria can be altered in the Nixpkgs configuration. 14 15 15 - Each of these criteria can be altered in the nixpkgs configuration. 16 + :::{.note} 17 + All this is checked during evaluation already, and the check includes any package that is evaluated. 18 + In particular, all build-time dependencies are checked. 19 + ::: 16 20 17 - The nixpkgs configuration for a NixOS system is set in the `configuration.nix`, as in the following example: 18 - 19 - ```nix 20 - { 21 - nixpkgs.config = { 22 - allowUnfree = true; 23 - }; 24 - } 25 - ``` 26 - 27 - However, this does not allow unfree software for individual users. Their configurations are managed separately. 28 - 29 - A user's nixpkgs configuration is stored in a user-specific configuration file located at `~/.config/nixpkgs/config.nix`. For example: 21 + A user's Nixpkgs configuration is stored in a user-specific configuration file located at `~/.config/nixpkgs/config.nix`. For example: 30 22 31 23 ```nix 32 24 { ··· 34 26 } 35 27 ``` 36 28 37 - Note that we are not able to test or build unfree software on Hydra due to policy. Most unfree licenses prohibit us from either executing or distributing the software. 29 + :::{.caution} 30 + Unfree software is not tested or built in Nixpkgs continuous integration, and therefore not cached. 31 + Most unfree licenses prohibit either executing or distributing the software. 32 + ::: 38 33 39 34 ## Installing broken packages {#sec-allow-broken} 40 35
+26 -4
nixos/doc/manual/configuration/customizing-packages.section.md
··· 1 1 # Customising Packages {#sec-customising-packages} 2 2 3 - Some packages in Nixpkgs have options to enable or disable optional 4 - functionality or change other aspects of the package. 3 + The Nixpkgs configuration for a NixOS system is set by the {option}`nixpkgs.config` option. 4 + 5 + ::::{.example} 6 + # Globally allow unfree packages 7 + 8 + ```nix 9 + { 10 + nixpkgs.config = { 11 + allowUnfree = true; 12 + }; 13 + } 14 + ``` 15 + 16 + :::{.note} 17 + This only allows unfree software in the given NixOS configuration. 18 + For users invoking Nix commands such as [`nix-build`](https://nixos.org/manual/nix/stable/command-ref/nix-build), Nixpkgs is configured independently. 19 + See the [Nixpkgs manual section on global configuration](https://nixos.org/manual/nixpkgs/unstable/#chap-packageconfig) for details. 20 + ::: 21 + :::: 22 + 23 + <!-- TODO(@fricklerhandwerk) 24 + all of the following should go to the Nixpkgs manual, it has nothing to do with NixOS 25 + --> 26 + 27 + Some packages in Nixpkgs have options to enable or disable optional functionality, or change other aspects of the package. 5 28 6 29 ::: {.warning} 7 - Unfortunately, Nixpkgs currently lacks a way to query available 8 - configuration options. 30 + Unfortunately, Nixpkgs currently lacks a way to query available package configuration options. 9 31 ::: 10 32 11 33 ::: {.note}