Guide to Nix's packaging system.
This repository has been archived on 2023-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
Install
Alpine Linux
- Install
xz shadow bash sudo curl
- Uncomment
%wheel ALL=(ALL:ALL) ALL
in /etc/sudoers
- Run the script:
sh <(curl -L https://nixos.org/nix/install) --daemon
- Make the file
nixd
in /etc/init.d
:
#!/sbin/openrc-run
description="Nix multi-user support daemon"
command="/usr/sbin/nix-daemon"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
- Make it executable:
doas chmod a+rx /etc/init.d/nixd
- Find the
nix-daemon
blob and move it to /usr/sbin
: doas mv $(doas find / -iname nix-daemon) /etc/sbin
- Enable the nix daemon:
doas rc-update add nixd
- Add the desired users to the
nixbld
group: doas adduser <user> nixbld
doas reboot
Normal
|
|
|
Multi-user |
Recommended. SELinux must be disabled. |
sh <(curl -L https://nixos.org/nix/install) --daemon |
Single-user |
/nix will be owned by the invoking user, which should not be root. |
sh <(curl -L https://nixos.org/nix/install) --no-daemon |
|
|
|
Can't decide?
Use
Find packages
|
|
Recommended |
Use their search engine with unstable checked. |
Alternative |
List all packages with nix-env -qaP . Tip: Use grep to search. |
|
|
Basic commands
|
|
List installed |
nix-env -q |
Install |
nix-env -iA nixpkgs.<packname> |
Uninstall |
nix-env -e <packname> |
Update all |
nix-env -u |
Update |
nix-env -u <packname> |
Hold a package |
nix-env --set-flag keep true <packname> |
List generations |
nix-env --list-generations |
Rollback to last gen |
nix-env --rollback |
Rollback to a gen |
nix-env --switch-generation # |
Nix stores all .desktop in $HOME/.nix-profile/share/applications
Symlinks should be enough fix: ln -s $HOME/.nix-profile/share/applications/* $HOME/.local/share/applications