How do I modify a derivation for a service locally?

I’m trying to modify this locally:

Namely, I’m trying to add the changes suggested by Microsoft for xrdp use in a hyper-v linux guess found here:

I’m not sure what is the best way to make these modifications locally. I’m not sure if I’m supposed to be looking at making an overlay like this:

As is probably obvious already, I’m a bit confused by the above, given that the nix derivation I’m trying to modify doesn’t seem to be a package?

I think the most proper thing would be to change the xrdp module to include hooks that you need for it to work successfully. You should be test it locally with nixos-rebuild switch -I nixpkgs=path/to/editted/default.nix. Once it works, submit a PR so that others may share :slight_smile:

Got any pointers as to where to start learning how to include said hooks?

Unfortunately I can’t find any good documentation on how to build NixOS modules, and I would hate to say, “look at source code” because it’s not a great way to learn. @Infinisil do you know of any resources?

If you mean “options” I think I can figure this out. To test this out, do I need to clone the repo and make my modifications there, then use -I /my/local/repo for testing the build? Or can I just have a single file (without the full clone)?

I personally would clone the repo, that way you can iterate with doing nixos-rebuild. If you’re doing this on a local machine, it probably won’t be too bad. But if you’re doing this on an azure VM, then it will be pretty bad.

You can go the single file route if you want to by utilizing disabledModules on the existing module and then import on your local coy.