Opinionates Nix per-repo flakes.
nix flake update --flake 'git+ssh://git@github.com/mccurdyc/nix-templates'
nix flake init --template 'git+ssh://git@github.com/mccurdyc/nix-templates?ref=main'
- List templates
nix flake show
- Update existing directory with template
nix flake init --template 'git+ssh://git@github.com/mccurdyc/nix-templates#full'
- Create new directory from template
nix flake new <target-dir> --template 'git+ssh://git@github.com/mccurdyc/nix-templates#full'
nix flake update
fd \
--type directory \
--exact-depth 1 \
--exec zsh -c "pushd {} && sed -i 's/24.05/24.11/g' flake.nix && sleep 5 && nix flake update"
- Using flake-parts
Jacek from Nixcademy said that he prefers flake-parts over flake-utils because of it's "flake composition". I haven't fought enough with either to have a strong preference, so I've opted to trust him.