Installing software globally
Probably the most common case, is wanting to install software system-wide. This is not technically system-wide in NixOS, due to its internal isolation properties, but the difference doesn't really matter for your day-to-day use.
Installing software globally is done by adding it to your environment.systemPackages
. For example, like so:
{
# ... other configuration goes here ...
environment.systemPackages = [
pkgs.htop
pkgs.iotop
];
# ... other configuration goes here ...
}
In this example, two packages are installed: htop
, and iotop
. As you can see, they are prefixed with pkgs. - this means that they are attributes (ie. properties) of the pkgs binding (ie. variable). The type of environment.systemPackages
is a list, containing derivations.
Once you have added the package(s) that you want to install to your systemPackages
, you need to rebuild the system to make the changes take effect.
No Comments