this post was submitted on 18 Jul 2023
3 points (100.0% liked)

nixos

1262 readers
2 users here now

All about NixOS - https://nixos.org/

founded 5 years ago
 

I've been messing around with nix flakes to configure my NixOS system and to put the final touches on I wanted to write an overlay of Neovim with the plugins and everything configured with Lua and then use this overlay to install neovim-qt. After reading various docs on Overlays, I get the fundamentals but I don't get where to look to find a list of all the configurable options that an overlay provides? Typically I can look in the home-mananger nix decleration of a package for the options exposed or nixpkgs for the options in configuration.nix. Any help that will dive deeper into overlays or where to find their options would be greatly appreciated!

you are viewing a single comment's thread
view the rest of the comments
[–] ck_@discuss.tchncs.de 2 points 2 years ago (2 children)

You can override derivation inputs and derivation attributes. Let's take for example the nano editor.

You can enable tidy support by overriding the enableTidy input like so:

(final: prev: { nano = prev.nano.override { enableTidy = true; }; })

You can also override build steps, eg. if you want to apply an upstream patch because you don't want to wait for the next release version, you'd do it like this.

(final: prev: { nano = prev.nano.overrideAttrs ( old: { patches = (old.patches or [] ) ++ [ ./filename.patch ]; }); })

Now the thing about overlays is this: if you change a package in an overlay, all packages depending on that package, either directly or indirectly, will pull in that modified version, which is an extremely powerful tool as you can probably imagine.

[–] Cebidaez@lemmy.sdf.org 2 points 2 years ago

It all makes sense now!

[–] Cebidaez@lemmy.sdf.org 1 points 2 years ago (1 children)

enableTidy

I recently had a chance to take a look at the nano.nix file on github responsible for building nano. But I don't see where the enableTidy attribute is declared did you mean enableTiny by any chance?

[–] ck_@discuss.tchncs.de 1 points 2 years ago

Yes, I do mean enableTiny. Sorry about the confusion :)