- Run
nixos-rebuild build --flake . --print-build-logs
to try building the configuration - Assuming it succeeds, run
sudo nixos-rebuild switch --flake .
to switch to the configuration you built- If you skip the build step, it'll build it automatically
- If you want it to take effect next boot (which you might, if you're making invasive changes), you can run
sudo nixos-rebuild boot --flake .
- Go to
home.nix
and find thepackages
option (attribute) under thehome
section (attrset). - Find the package on https://search.nixos.org
- Add it to the
home.packages
list with apkgs.
on front, e.g.pkgs.discord
- If it's proprietary, you may need to mark the license as agreed-to
- Find the list in the
nixpkgs.config.allowUnfreePredicate
setting inconfiguration.nix
- Add the package name to there as a string, e.g.
"discord"
- (The error that you get from the next step will tell you the right name if you skip this step)
- Find the list in the
- Do the "Update the configuration" steps above
(This doesn't apply to this repo, but it applies to some other projects set up with Nix+direnv.)
- Go to the
flake.nix
for the project - Find the list of dependencies under
nativeBuildInputs
- Add the dependency there, starting with
pkgs.
(like above)
In more complicated projects, this might not apply, but in simple ones only using Nix to fetch development dependencies (rather than building the project itself using Nix), this should generally work