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
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
So we need to unpack two things here
options
is what you typically need to specify in yourconfiguration.nix
or via home-manager. They can be found hereOverlays are mostly used to overwrite attributes or build inputs, eg.
(final: prev: { foo = prev.foo.override { bar = "baz"; }; })
Now I am not particularly sure about how home-manager and neovim work together, but it looks like the module takes an option to set the program, so I'd consider just plucking your neovim-qt program right in there.
Inside of this example would the sets that are changeable inside of .override like bar for example be the definitions made within the .nix file for a respective package? I'm trying to understand how I know what can be overridden.
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.
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?
Yes, I do mean
enableTiny
. Sorry about the confusion :)