3 ms·
Yes, in Nix code it is possible to refer to arbitrary Nix codebases from Nix code. I'd point to the home-manager installation instructions for an example of Ni
by rgoulter 3y ago
Yes, in Nix code it is possible to refer to arbitrary Nix codebases from Nix code.
I'd point to the home-manager installation instructions for an example of Nix flakes having a nicer UX. Running flake-enabled codebases is just much nicer than non-flake codebases.
https://nix-community.github.io/home-manager/index.html#sec-install-standalone https://nix-community.github.io/home-manager/index.html#sec-...
https://nix-community.github.io/home-manager/index.html#sec-flakes-standalone https://nix-community.github.io/home-manager/index.html#sec-...
The former involves running `nix-channel --add <...> home-manager && nix-channel --update` in order for `<home-manager>` to mean anything. With the latter, it's simply `nix run home-manager/release-23.05 -- init --switch`. (Albeit, `home-manager` is already registered as an alias for `github:nix-community/home-manager`).
One key detail is that `nix-channel --add` modifies the 'system state', whereas running flakes essentially does not.
-- Regarding "you can pull in arbitrary Nix code by reference". With flakes, you have a standard entry point where you know the interface it has. Whereas, having a 'default.nix' is a convention, and there's no way to know how a `default.nix` is to be used without reading its source.