nixos/modules/config/resolvconf.nix: skip systemPackages if disabled

A change made in #166308 added `networking.resolvconf.package` to the
`environment.systemPackages` list, so it is installed as part of the
system image. However it does so unconditionally, meaning that even if
the `config.networking.resolvconf.enable` is set to false the package
listed in the `networking.resolvconf.package` would still be intalled.

This change makes it so the package installation will depend on the
status of the `config.networking.resolvconf.enable` option instead.
This commit is contained in:
Garry Filakhtov 2023-03-18 11:50:45 +11:00
parent 5e2ca1e02f
commit d86e9911cd
No known key found for this signature in database

View file

@ -132,13 +132,13 @@ in
exit 1
''
else configText;
environment.systemPackages = [ cfg.package ];
}
(mkIf cfg.enable {
networking.resolvconf.package = pkgs.openresolv;
environment.systemPackages = [ cfg.package ];
systemd.services.resolvconf = {
description = "resolvconf update";