nix gotchas
by [lockbox]Table of Contents
Updating Nix daemon settings
TLDR;
sudo kill-all nix-daemon
or
nix -k <command you were going to run>
Why do you need to restart the daemon when a config file is changed as opposed to just telling it to reload? Not sure but this works for now.
Related github issue
NixOS autoreload config file on change
Nix only tracks things added to git
when using flakes you must at least stage changes to git, otherwise you will get very difficult to debug errors
eg. your working directory looks like
fd
and you make a change to systems/default.nix
.
git status
Then you attempt to use or import systems
, as an exmaple just try to execute it inline with the repl:
,#+begin_src shell nix repl –file systems/ #+end_src
you will actually be execcuting on the previous state of default.nix
that git has in its object store
until you git add
, or commit etc.