2021-06-27 VERY FIRST STEPS WITH NIX ON DEBIAN Mixing Debian with Nix[1], my first steps. ================= O U T D A T E D ================= This information about Nix and Debian is out of date. Don't use this. 2 Why Nix? ========== Because Debian is currently frozen[2]. Or, because $some_package is not (yet) available in Debian. 3 Installation. =============== To install, as root, do: ,---- | apt install nix nix-setup-systemd `---- then, as user: ,---- | nix-channel --add https://nixos.org/channels/nixpkgs-unstable | nix-channel --update `---- followed by a package you wish to run from Nix. For example, Nyxt[3]. (19 May 2022: In an earlier version of this blog, I had written" nix-channel update", without the hyphens. Thanks, Greg) ,---- | nix-env --install nyxt `---- To find this Nyxt and other applications you install via Nix, you should add the path to your shell. For example: ,---- | export PATH=$PATH:$HOME/.nix-profile/bin `---- If this works for you, add it to your .bashrc. Lastly, check if you're in the group nix-users. If not, as root ,---- | adduser $your_user_name_here nix-users `---- 4 Errors ======== If you get ,---- | error: opening lock file ‘/nix/var/nix/profiles/per-user/root/profile.lock’: Permission denied `---- then rm ~/.nix-profile and try again. This is probably because you tried to use nix-env or nix-channel or something while root ([4]). 5 Maintenance ============= Three basic commands to keep your Nix packages up to date: ,---- | nix-channel --update nixpkgs | nix-env -u '*' | nix-collect-garbage -d `---- [1]: https://en.wikipedia.org/wiki/Nix_package_manager [2]: https://release.debian.org/bullseye/freeze_policy.html [3]: https://nyxt.atlas.engineer/ [4] https://discourse.nixos.org/t/nix-env-error-opening-lock-file/3556