Setup to try to hack nixos

What you do when hacking nixos modules and you want to try a new option or modify an existing one?Do you modify directly your configuration.nix and call nixos-rebuild switch -I nixpkgs=.?
Or you do something more sophisticated,to avoid rebuilding your entire system for an one-off test?

1 Like

I do pretty much that, although I’m sure there’s a better approach. I therefore try and base my hacking on the commit my machine is on so I don’t have to rebuild too much stuff!

I usually write a VM test and during experimentation just use the test drivers. That also has the added benefit that once you upstream the module you have a test case.

I usually branch off of unstable, so that I can still make use of the binary cache.