about summary refs log tree commit diff
path: root/nixos/modules/config/resolvconf.nix
diff options
context:
space:
mode:
authorGarry Filakhtov <filakhtov@gmail.com>2023-03-18 11:50:45 +1100
committerGarry Filakhtov <filakhtov@gmail.com>2023-03-29 09:31:09 +1100
commitd86e9911cd9051fc671215fd51295507beeeb48b (patch)
tree15d3ab6ed837e52bb677230380ead7953042ae17 /nixos/modules/config/resolvconf.nix
parent5e2ca1e02f7a1bc94688789ec6e39bd0bcf47832 (diff)
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.
Diffstat (limited to 'nixos/modules/config/resolvconf.nix')
-rw-r--r--nixos/modules/config/resolvconf.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/config/resolvconf.nix b/nixos/modules/config/resolvconf.nix
index 76605a063a47a..e9ae4d651d264 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";