Install a package on the Pubnix: Difference between revisions

From Project Segfault Wiki
(formatting)
(add remove pkg cmd)
Line 10: Line 10:
Note: Incase you used the nix search method, the package name will not include the legacyPackages.x86_64-linux part.  
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: <pre>nix-env -iA nixpkgs.(package)</pre> and it will be installed! For example, you can run: <pre>nix-env -iA nixpkgs.neofetch</pre> and when that's complete <pre>neofetch</pre> will work on your user! If you want to install a package for only your user, you can run:
If you find the package you wanted on there, you can run: <pre>nix-env -iA nixpkgs.(package)</pre> and it will be installed! For example, you can run: <pre>nix-env -iA nixpkgs.neofetch</pre> and when that's complete <pre>neofetch</pre> will work on your user! If you want to install a package for only your session, you can run:
<pre>nix-shell -p (package)</pre>
<pre>nix-shell -p (package)</pre>
This article only includes the common commands. Check out the [https://nixos.wiki/wiki/Ubuntu_vs._NixOS Ubuntu vs. NixOS] page on the NixOS Wiki to get a cheatsheet on more!
Finally, to remove a package, you can run:<pre>
nix-env -e (package)
</pre>This article only includes the common commands. Check out the [https://nixos.wiki/wiki/Ubuntu_vs._NixOS Ubuntu vs. NixOS] page on the NixOS Wiki to get a cheatsheet on more!
[[Category:Pubnix]]
[[Category:Pubnix]]

Revision as of 09:14, 15 March 2023

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 session, you can run:

nix-shell -p (package)

Finally, to remove a package, you can run:

nix-env -e (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!