I’m trying to gain a better understanding of NixOS and am working on removing unneeded dependencies. For example, fzf
has perl
as a dependency and when i enable printing, samba
is installed. I want to get rid of both dependencies.
So i read through the wiki, the NixOS options and some articles on discourse about overlays. It is my understanding that i don’t need “old:” because i only want to remove things. I don’t know when “rec” is necessary.
This is what i came up with in my configuration.nix
(i tried both “null” and “” to assign an empty value):
{
config,
pkgs,
lib,
...
}: {
imports = [
./hardware-configuration.nix
./hardening.nix
];
nixpkgs = {
config = {
packageOverrides = pkgs: {
unstable = import <nixos-unstable> {config = config.nixpkgs.config;};
};
};
overlays = [
(final: prev: {
cupsd = prev.cupsd.overrideAttrs {additionalBackends = "";};
})
(final: prev: {
fzf = prev.fzf.overrideAttrs {ourPerl = null;};
})
];
};
...
Running sudo nixos-rebuild
shows no error but doesn’t change anything.
Also, i succeeded in making the following override:
environment.systemPackages = with pkgs; [
(easyeffects.overrideAttrs
{
preFixup = let
lv2Plugins = [
calf # compressor exciter, bass enhancer and others
zam-plugins # maximizer
];
in ''
gappsWrapperArgs+=(
--set LV2_PATH "${lib.makeSearchPath "lib/lv2" lv2Plugins}"
)
'';
})
];
I then tried to convert that to a global overlay by doing the following:
...
overlays = [
(final: prev: {
easyeffects = prev.easyeffects.overrideAttrs
{
preFixup = let
lv2Plugins = [
calf # compressor exciter, bass enhancer and others
zam-plugins # maximizer
];
in ''
gappsWrapperArgs+=(
--set LV2_PATH "${lib.makeSearchPath "lib/lv2" lv2Plugins}"
)
'';
}
];
})
...
but if i do that, NixOS complains with “undefined variable calf
” and it will also complain for zam-plugins
. If i put that part into ‘’ ‘’ like the gappsWrapperArgs, then NixOS doesn’t complain anymore but also removes calf
and zam-plugins
as it obviously disregards them in this case.
Obviously i don’t understand fundamental parts of how overlays work but the examples in the wiki don’t seem to help me.
How can i achieve what i want?