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!

  • ck_
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    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.orgOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      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_
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

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