How can I have a separate uncommited settings file in a flake repository

Hello all,
I use a flake based nixos config that I import some configuration settings into in, which then get inherited by the modules. The problem is I would like to commit this to github publicly without any personal information included, but still include a template for the settings file. I have been using this fine with git update-index --no-assume-unchanged settings.nix, but this has stopped working since I updated the flake earlier. It now displays error: getting status of '/home/USERNAME/nixos/themes/wallpapers/city_sunset.png': No such file or directory when running rebuild switch, which should have replaced USERNAME with the username defined in the local settings file but instead used the version committed in the repository.
What is the proper way to have settings.nix locally without its changes being committed?

The config repository

Flakes are copied into the store before the evaluation, so if the rest of the flake is tracked in git – the file needs to be tracked.

You have two options here:

  • If you don’t mind the file to end up in a public repository but don’t want the file in cleartext, you can use git-crypt with filters

  • If you don’t want the file in the public repo at all, you can create a private input for the public flake and expose the file through a module exported by the private flake