r-raymond / nixos-mailserver

A complete and Simple Nixos Mailserver
GNU General Public License v3.0
181 stars 27 forks source link

Use overlays #85

Open jpotier opened 6 years ago

jpotier commented 6 years ago

A very nice example on how to use this is there: https://github.com/yegortimoshenko/nixos-overlay

r-raymond commented 6 years ago

Thanks for pointing this out! I'll take a look asap.

jpotier commented 6 years ago

I'm overthrilled since I read about this. It makes things so much simpler. Another example of use is musnix.

r-raymond commented 6 years ago

Well it looks like we should convert SNM to use overlays. Is there any official documentation? The examples above simply add master, we should have something more sofisticated reflecting different versions.

jpotier commented 6 years ago

Github provides tgz for any branch/tag so that could be used.

Documentation is scarce unfortunately: https://nixos.org/nixpkgs/manual/#sec-overlays-install

Other examples:

Rust overlay: https://github.com/mozilla/nixpkgs-mozilla Radeon OpenCompute overlay: https://github.com/peter-sa/nixos-rocm

eqyiel commented 6 years ago

@jbboehr @r-raymond the thing about overlay is that they are useful for modifying the package set (which this repo doesn't do), not NixOS modules. If I'm mistaken here, I'd very much like to know about it though!

jpotier commented 6 years ago

@eqyiel true, overlays are about modifying the package set. So if you ever want to add custom flags on top of the default package set, that's the way you'd go.

Having the code infrastructure in place may be a good thing to have, if for any future version of nixpkgs, there's something in need of hotfixing (it did happen in the past).

Also, having users just add your module+overlay at once using nix-channels is a nice plus.