Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How-To Doc #441

Open
JasonGoemaat opened this issue Mar 20, 2024 · 1 comment
Open

How-To Doc #441

JasonGoemaat opened this issue Mar 20, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@JasonGoemaat
Copy link

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.

@0xLunch
Copy link

0xLunch commented Apr 8, 2024

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.

@nzbr nzbr added the documentation Improvements or additions to documentation label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants