-
-
Notifications
You must be signed in to change notification settings - Fork 286
Description
I noticed this after hyprpaper stopped building and breaks my configuration (see #542). But the thing is, i don't use hyprpaper or hyprland. I use niri and swaybg. hyprpaper shouldn't be in my system closure at all, my system configuration has zero matches for hypr. but the stylix hyprland module always sets services.hyprpaper.enable = true: unless i opt out by disabling that target or setting stylix.autoEnable = false;. it would make sense if hyprland was actually enabled, to also enable hyprpaper for the theming. but i don't use hyprland, this shouldn't be enabled by default.
for a lot of options like dunst this is perfectly okay, because all it does is set some dunst settings. these don't do anything by themselves other than possibly generating a config file. but the Hyprland module (and likely a few others) do additional stuff, that actually increase the size of my system closure.
it would make a lot of sense if the standard lib.mkIf prelude in stylix would check for the relevant program being enabled in general. e.g. services.hyprpaper.enable = true; should be gated behind a mkIf wayland.windowManager.hyprland.enable. if i understand it right, it would probably be easiest and cleanest to do this in the autoEnable parameter of mkEnableTarget, simply passing the relevant enable gate rather than unconditionally setting that to true.
this change should really be unconditionally part of all modules, really rather than just those that look to "have side-effects", because truth is, even if they are just setting the options, that might have the side effect of causing a file to be generated that otherwise wouldn't be. this happens for example in my niri module (which isn't part off this repo, but would fit right in as far as i'm concerned) and isn't a huge issue since it's "just" the config file, but it goes against the general philosophy of nix and ultimately contributes to added evaluation time and closure sizes, even for modules you never enabled or even knew existed!