A hack to efficiently install the flakes maintained at my home.
This is for:
- "dirty" (local, temporary) flakes and packages
- ... that I currently maintain and install
- ... but do not want in my home-manager profile
It basically tries to reinvent the "dirtiness" of nix-env
and nix-channel
with flakes.
Why? Here are some facts:
- each project has to be in its own git repository
- each package carries along its own dependencies, e.g.
nixpkgs
nix is terrible with git submodules, at least for now
(this is fixed as of nix v2.23.3)
Without this hack, we have the following problems:
- there will be N copies of deps, e.g.
nixpkgs
floating in my system - bringing them up to date requires many
cd
s andnix flake update
s
This flake solves the problem by:
- gathering all these packages into a single env so I can
nix profile install
all of them - redirecting common dependencies e.g.
nixpkgs
to the nix registry so I cannix flake update
all of them - in fact,
nix flake update
is in.envrc
so the flake inputs are automatically synced with the localnix registry
circumventing the submodule issues with a separate--git-dir
at some other location
(this is now obsolete since nix v2.23.3)
I do use home-manager but these are the temporary packages I specifically do not want to keep track of.
We are emulating the cursed nix-env
& nix-channel
functionality, where things are dirty yet efficient.