Is there a way to test my changes of that module by just overwriting the services.crowdsec module?
I’ve tried to import my changes into my system but then I’m getting this (understandable) error:
error: The option `services.crowdsec.enable' in `/nix/store/sizirny50f893gx0gbivbqyys4fxghnq-source/nixos/modules/services/security/crowdsec.nix' is already declared in `/nix/store/bwb7ldiyx7shckg7rdkwwva6wlp4cs6g-source/systems/pc/crowdsec.nix'.
You can also use something like this stunt to patch your nixpkgs on the fly with selected PRs. I prefer this approach, because it does conceptually what you want (“test that PR”), without you needing to fiddle with module paths. I also had some issues with disabledModules where it was not clear what to disable exactly. Here’s my summary thread to the options you have:
Hey not sure if this is helpful or if you knew about it already, but you might be interested in nixosTest (undocumented, but just a wrapper??)/runNixOSTest. I just found out about it, and I’m using it to test out a module I wrote. It automatically creates a nixOS vm and goes through a set of Python tests.
Useful for module development, because you don’t have to test on your actual system, you can just do the development in a flake that spools up a vm for evaluation.