From d86e9911cd9051fc671215fd51295507beeeb48b Mon Sep 17 00:00:00 2001 From: Garry Filakhtov Date: Sat, 18 Mar 2023 11:50:45 +1100 Subject: [PATCH] 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. --- nixos/modules/config/resolvconf.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/config/resolvconf.nix b/nixos/modules/config/resolvconf.nix index 76605a063a47..e9ae4d651d26 100644 --- a/nixos/modules/config/resolvconf.nix +++ b/nixos/modules/config/resolvconf.nix @@ -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";