From 94819fdb5f0b624fd4e8233a064c0eaa1479c170 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 22 Oct 2020 20:24:41 +0200 Subject: [PATCH 1/2] nixos/dbus: re-add a dummy socketActivated option If set, then issue a warning instead of an error as previously. --- nixos/modules/services/system/dbus.nix | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix index d9dd26f0f18..f8d909a4a3c 100644 --- a/nixos/modules/services/system/dbus.nix +++ b/nixos/modules/services/system/dbus.nix @@ -1,6 +1,6 @@ # D-Bus configuration and system bus daemon. -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; @@ -18,13 +18,6 @@ let in { - - imports = [ - (mkRemovedOptionModule - [ "services" "dbus" "socketActivated" ] - "The user D-Bus session is now always socket activated and this option can safely be removed.") - ]; - ###### interface options = { @@ -57,12 +50,29 @@ in pkg/share/dbus-1/services ''; }; + + socketActivated = mkOption { + type = types.nullOr types.bool; + default = null; + visible = false; + description = '' + Removed option, do not use. + ''; + }; }; }; ###### implementation config = mkIf cfg.enable { + warnings = optional (cfg.socketActivated != null) ( + let + files = showFiles options.services.dbus.socketActivated.files; + in + "The option 'services.dbus.socketActivated' in ${files} no longer has" + + " any effect and can be safely removed: the user D-Bus session is" + + " now always socket activated." + ); environment.systemPackages = [ pkgs.dbus.daemon pkgs.dbus ]; From e0fa72d04d75f7d7e5a0b3d45a69825f209589f9 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 22 Oct 2020 20:28:22 +0200 Subject: [PATCH 2/2] docs: update documentation of `mkRemovedOptionModule` Since b08b0bcbbec77046e5a7082177cedc12fbf1dc6c, the function actually causes an assertion error, not a warning. --- lib/modules.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules.nix b/lib/modules.nix index df3a2ad17e5..103a22ed131 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -719,7 +719,7 @@ rec { mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] "" - causes a warning if the user defines boot.loader.grub.bootDevice. + causes a assertion if the user defines boot.loader.grub.bootDevice. replacementInstructions is a string that provides instructions on how to achieve the same functionality without the removed option,