Install a package on the Pubnix

From Project Segfault Wiki
Revision as of 10:09, 4 March 2023 by Arya (talk | contribs) (formatting)

So you have a package you want to run...

No worries! The Project Segfault Pubnix has the Nix package manager installed, meaning that you can install a package in your user only. This allows for all the users to run basically whatever they want without requiring us to install it.

Step one is to find the package you want in nixpkgs. You can search packages at NixOS' search site.

Additionally, you can also search for packages from the CLI. For that, you can run:

nix search nixpkgs (package)

Note: Incase you used the nix search method, the package name will not include the legacyPackages.x86_64-linux part.

If you find the package you wanted on there, you can run:

nix-env -iA nixpkgs.(package)

and it will be installed! For example, you can run:

nix-env -iA nixpkgs.neofetch

and when that's complete

neofetch

will work on your user! If you want to install a package for only your user, you can run:

nix-shell -p (package)

This article only includes the common commands. Check out the Ubuntu vs. NixOS page on the NixOS Wiki to get a cheatsheet on more!