I actually have a literate NixOs config and I want to migrate to flakes.
As I have understood applying a flake all the files tracked by git are copied in the Nix store. The problem is that in my git repo all markdown files, the Makefile, and other utilities are tracked (and they have not to be copied), instead the tangled nix files (which are the only ones to be copied to the store) are in .gitignore since I don’t want them in my git repo as they are an artifact generated by tangling the markdown files.
I thought to tangle them in a temporary folder, initialize a git repo and then applying the flakes but this trick is unnecessary complicated and doesn’t allow me to track the lock file (I have to add an instruction to re-copy it back to the project folder in the makefile).
So are there any better practice to achieve this?
My actual dotfiles: Files · 12eb3c78a6712a4266c74c3b073cfd64a2f5b619 · Davide Peressoni / dotfiles · GitLab
relevant parts of the Makefile (config folder is gitignored):
install-system: build-system
sudo nixos-rebuild switch -I nixos-config="./config/configuration.nix"
install-home: build-home
home-manager switch -b bak -f "config/home.nix"
build-%: src/%
@mkdir -p config
cd config && lmt `find ../$</ -type f -name '*.md'`