F44 Change Proposal: Nix package tool [SelfContained]
This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.
Summary
Add the [GitHub - NixOS/nix: Nix, the purely functional package manager nix] functional package manager developer tool to Fedora.
Owner
- Name: [[User:Petersen| Jens Petersen]]
- Email: petersen@redhat.com
- Name: [[User:zbyszek| Zbigniew JÄdrzejewski-Szmek]]
- Email: zbyszek@in.waw.pl
Detailed Description
Nix is a cross-platform package manager for Unix-like systems with its own package ecosystem.
It is also the package manager for the NixOS Linux operating system.
The nix package tool provides access to the [GitHub - NixOS/nixpkgs: Nix Packages collection & NixOS nixpkgs] ecosystem with over 100,000 [NixOS Search packages].
Packages and environments can be specified in nixâs declarative functional programming language using so-called derivations. Nix [Flakes - NixOS Wiki flakes] provide a newer way to specify these project development environments.
Nix has two main modes of installation/setup: multi-user mode (with nix-daemon) and single-user mode
(below these are abbreviated as âmultiuserâ and âsingleuserâ respectively). The Fedora package tries to support both of them, though multiuser mode setup where available is more seamless. It does this by providing nix-daemon and nix-system subpackages which both require nix-filesystem. The /nix toplevel directory is defined with tmpfiles.d and can be a Btrfs subvolume if setup.
Feedback
Benefit to Fedora
Some developers and upstream projects now prefer or use nix for development and reproducible build environments.
Just as we have apt packaged in Fedora, this change adds a nix package allowing access to its ecosystem from Fedora.
With the implementation of this Change, Fedora users will be able to install nix easily on their system and leverage it in development projects that may require nix. They will also be able to easily try out some of the many packages in nixpkgs for testing or experimenting, etc.
For some time I have maintained a nix [petersen/nix Copr copr repo] which is quite popular (see the download numbers and note a number of other nix copr repos also exist), but it will be easier for Fedora users to have the nix package directly available from Fedora repos.
Scope
-
Proposal owners:
** prepare the [Making sure you're not a bot! package] of nix version 2.31 or later [[2388768 â Review Request: nix - A purely functional package manager pkgreview]] -
Policies and guidelines:
** We have received an [Making sure you're not a bot! exception approval] from FESCO to allow the nix package to use /nix toplevel directory at runtime, as it is needed to make full use of nixpkgs and cachix binaries, etc.
** The approved exception still needs to be documented
** To be clear: nix and its subpackages will remain optional development packages that Fedora users can install manually if they wish, and in particular /nix is not to be used for Fedora Linux development. -
Trademark approval: N/A (not needed for this Change)
-
Alignment with the Fedora Strategy:
Upgrade/compatibility impact
Early Testing (Optional)
N/A
How To Test
Copr builds are available from petersen/nix Copr.
Installation/setup:
Either:
- Multiuser daemon mode:
**sudo dnf install nix
**sudo systemctl enable --now nix-daemon
or
- Singleuser mode
**sudo dnf install nix --exclude nix-daemon
**sudo usermod -G nixbld -a $USER
See also /usr/share/doc/nix/README.fedora.md or Making sure you're not a bot!.
Then try out the tool:
nix-shell -p hello- try the
*.nixexamples in Making sure you're not a bot! nix search nixpkgs <package-regexp>- try online documentation examples or projects
Notes:
- Upstream recommends using the nix-daemon and multiuser mode.
- However
/nixis incompatible with ostree (it can probably be used in bootc Image Mode): so on ostree systems one should use it within a toolbox instead. - Since containers and toolbox normally do not have functioning systemd: it is not possible to use nix-daemon inside containers by default
** instead install the nix-singleuser subpackage - Be warned that nix can easily use up ââlarge amounts of diskspaceââ. You can use
nix-collect-garbageto clean up or clear/nix/store/. In the worst case it should be safe to removerm -r /nix/store/*completely. The/nixtree can also safely be removed after uninstalling nix. - Please use nix and nixpkgs etc at your own risk, as you would other upstream package ecosystems.
User Experience
Fedora users can now seamlessly install and use the Nix package manager for development or running its packages locally on their system.
Dependencies
There are no blocking dependencies. However:
- newer boost library would allow shipping latest nix 2.32 [in progress]
- mdbook (rust-based documentation tool) would probably allow building the documentation (and manpages) [under review]
Contingency Plan
Documentation
See Nix reference manual â nix.dev documentation.
Release Notes
- The Nix package manager developer tool has been packaged in Fedora for users.
Last edited by @alking 2025-10-28T12:33:45Z
Last edited by @alking 2025-10-28T12:33:45Z