|
|
|
|
|
by nomurrcy
2201 days ago
|
|
Overlays can be very helpful for this type of thing. I have overlays in ~/.config/nixpkgs/overlays.nix (though you do this various ways) My overlay file has the form: let
my-packages-overlay = self: super:
{
foo = super.callPackage ./path/to/package.nix {}
}
in
[ my-packages-overlay ] Then you can just nix-env -iA your-package. See: https://nixos.wiki/wiki/Overlays |
|
This is what always gets me stuck. It seems like lots of tutorials assume you're installing packages by hand still. For me, the whole reason I'm using nix is so that I can use the declarative package management.
I get having local dev dependencies on a per-project basis and running a nix shell to make those dependencies available in your development environment.
But it's just confusing to me how many tutorials suggest running nix-env -i to imperatively install a package. Why would I do that instead of taking advantage of the joys of declarative package management?