Store path starts with illegal character '.'

I updated my system today to Nix 2.18.2 (nixpkgs commit 20f77aa09916374aa3141cbc605c955626762c9a) and getting nix store errors all over the place because one of my home-manager home.files contained a source with a filename which is hidden (i.e. prefixed with a dot).

Does anybody know why this is suddenly a problem?
I renamed the offending source path and now I am struggeling to remove the offending store path which is no longer in use. nix-store --delete, nix-collect-garbage and the like all complain with:

error: store path 'wk4ylz2adn2i5hrhc6rq7bsllfazs5nw-.streamdeck_ui.json' starts with illegal character '.'

1 Like

This was actually a fix of a regression against an even older version of Nix: StorePath: reject names starting with '.' by edef1c · Pull Request #9095 · NixOS/nix · GitHub

It was deliberately re-introduced starting with 2.19: #912 allow leading period by roberth · Pull Request #9867 · NixOS/nix · GitHub

Thanks for pointing me at the relevant PR @fricklerhandwerk! That is exactly what I was looking for.
Unfortunately, reading through the PR and the discussions, I do not understand how to deal with the issue. The nix maintainers meeting protocol says: “No real solution except allowing them internally (just forbid creating new ones)”

However, it seems that they are not allowed internally, are they?

I ran into this on NixOS unstable as well recently, my workaround was to set nix.package = pkgs.nixVersions.unstable;, nixos-rebuild, and run the GC again.


Thanks so much! The temporary switch to nix unstable solved my issue.