|
|
| Line 21: |
Line 21: |
| Most users will want the stable/large channel, currently <code>nixos-23.11</code>. | | Most users will want the stable/large channel, currently <code>nixos-23.11</code>. |
|
| |
|
| Like packages installed via <code>nix-env</code>, channels are managed at user-level. NixOS uses the channels set for the <code>root</code> user to update the system-wide configuration; channels set for other users control only the user environment for that user. If you wish to change the channel used by the system-level configuration (<code>/etc/nixos/configuration.nix</code>), ensure you run the correct <code>nix-channel</code> command as root:
| | NixOS uses [https://nixos.org/manual/nix/stable/command-ref/files/profiles Nix profiles] for the <code>root</code> user to refer different versions of the system-wide configuration. Profiles set for other users control only the user environment for that user. |
| | |
| {| class="wikitable"
| |
| |+ Common nix-channel commands
| |
| |-
| |
| |Listing current channels
| |
| |<code>nix-channel --list</code>
| |
| |-
| |
| | Adding a primary channel
| |
| |<code><nowiki>nix-channel --add https://nixos.org/channels/channel-name nixos</nowiki></code>
| |
| |-
| |
| | Adding other channels
| |
| |<code><nowiki>nix-channel --add https://some.channel/url my-alias</nowiki></code>
| |
| |-
| |
| | Remove a channel
| |
| |<code>nix-channel --remove channel-alias</code>
| |
| |-
| |
| | Updating a channel
| |
| |<code>nix-channel --update channel-alias</code>
| |
| |-
| |
| | Updating all channels
| |
| |<code>nix-channel --update</code>
| |
| |}
| |
| | |
| Note that updating channels won't cause a rebuild in itself; if you want to update channels and rebuild, you can use <code>nixos-rebuild</code> with the <code>--upgrade</code> flag to do both in one step.
| |
|
| |
|
| == Channel update process == | | == Channel update process == |