NixOS-WSL icon indicating copy to clipboard operation
NixOS-WSL copied to clipboard

How-To Doc

Open JasonGoemaat opened this issue 11 months ago • 1 comments

Very new to Nix, love this repository but had a hard time figuring out how to just add packages to the global configuration.nix. I saw there was a space for a howto doc that wasn't created so I decided to add some examples.

JasonGoemaat avatar Mar 20 '24 18:03 JasonGoemaat

You'll want to do a bunch of googling on different setups since there are multiple ways to get your programs installed. I'll give a quick rundown here but this is more a question for Nix communities directly and not specific to NixOS-WSL.

For global system-wide packages that will exist for every user, every system, etc you can use environment.systemPackages inside your etc/nixos/configuration.nix file example:

  # System Packages
  environment.systemPackages = with pkgs; [
    zsh
    wget
    htop
    tmux
  ];

When you sudo nixos-rebuild switch these will be included systemwide.

Another way is to simply enable a program that's in nixpkgs, ie: programs.zsh.enable = true. This can be done in your general configuration, or more preferably within your home-manager config so it applies to your specific user and not the entire system.

Hope this points you in the right direction.

0xLunch avatar Apr 08 '24 00:04 0xLunch

This is basically a duplicate of #442, so I'm closing this issue

nzbr avatar Oct 13 '24 22:10 nzbr