New to Nix and NixOS and I’ve run into a rather basic issue which I’m hoping someone here could explain to me.
I have a working NixOS flake setup with AwesomeWM. If I edit a file under /etc/nixos and run sudo nixos-rebuild switch --flake .# the file updates as expected. However if I were to create a new file or folder within the nixos dir, these are not created or linked when running sudo nixos-rebuild switch --flake .#. If it is not a nix file, e.g. an awesomewm file residing in the nixos dir which nix links to ~, then the rebuild still completes. If the file is nix-related then the rebuild fails, because the file does not exist in /etc/nix/store/*…
Have I misunderstood the nixos-rebuild command? What command/flag is appropriate in this case?
In this case the default.nix includes home.file.".config/awesome".source = ./config; and it is/was creating this dir in ~/.config. The awesome files are there, presumably from the initial installation, but new ones are not created/linked.
When you make a new file in a git repo, it isn’t “tracked” by git until you git add the file. Nix flakes deliberately ignores files in your repo that are not tracked.
Yea it’s a tad inconvenient but I’ve found it more useful than harmful. I can have tons of crappy scratch files like disk images in my worktree and it won’t result in nix copying all of those into the store every time I do an eval.