Skip to main content
Added more clarity
Source Link

Using nix-env to install packages for the system is not recommended. If you want to add packages to your system for all users, check this portion of the manual. In short, you doedit your configuration.nix to have:

environment.systemPackages = with pkgs; [ <your package here> ] 

Then, if you want to edit the configuration for it, you can visit this website to see the options for that package. For example, in vim's case, an example config would be:

programs.vim = { enable = true; defaultEditor = true; }; 

This way, you can have your entire configuration be declarative. If you want to have per-user programs and configs, you can follow the guide in @Vladimír Čunát's comment for home-manager. It's a little extra setup, but it's very similar to the way to install things for the entire system. Home-manager also has some extra options for some packages, so be sure to check them in the home-manager manual, one of which can be found here.

Using nix-env to install packages for the system is not recommended. If you want to add packages to your system for all users, check this portion of the manual. In short, you do

environment.systemPackages = with pkgs; [ <your package here> ] 

Then, if you want to edit the configuration for it, you can visit this website to see the options for that package. For example, in vim's case, an example config would be:

programs.vim = { enable = true; defaultEditor = true; }; 

This way, you can have your entire configuration be declarative. If you want to have per-user programs and configs, you can follow the guide in @Vladimír Čunát's comment for home-manager. It's a little extra setup, but it's very similar to the way to install things for the entire system. Home-manager also has some extra options for some packages, so be sure to check them in the home-manager manual, one of which can be found here.

Using nix-env to install packages for the system is not recommended. If you want to add packages to your system for all users, check this portion of the manual. In short, you edit your configuration.nix to have:

environment.systemPackages = with pkgs; [ <your package here> ] 

Then, if you want to edit the configuration for it, you can visit this website to see the options for that package. For example, in vim's case, an example config would be:

programs.vim = { enable = true; defaultEditor = true; }; 

This way, you can have your entire configuration be declarative. If you want to have per-user programs and configs, you can follow the guide in @Vladimír Čunát's comment for home-manager. It's a little extra setup, but it's very similar to the way to install things for the entire system. Home-manager also has some extra options for some packages, so be sure to check them in the home-manager manual, one of which can be found here.

Source Link

Using nix-env to install packages for the system is not recommended. If you want to add packages to your system for all users, check this portion of the manual. In short, you do

environment.systemPackages = with pkgs; [ <your package here> ] 

Then, if you want to edit the configuration for it, you can visit this website to see the options for that package. For example, in vim's case, an example config would be:

programs.vim = { enable = true; defaultEditor = true; }; 

This way, you can have your entire configuration be declarative. If you want to have per-user programs and configs, you can follow the guide in @Vladimír Čunát's comment for home-manager. It's a little extra setup, but it's very similar to the way to install things for the entire system. Home-manager also has some extra options for some packages, so be sure to check them in the home-manager manual, one of which can be found here.