diff --git a/modules/services/pass-secret-service.nix b/modules/services/pass-secret-service.nix index d7eb48a28..2a4acbd66 100644 --- a/modules/services/pass-secret-service.nix +++ b/modules/services/pass-secret-service.nix @@ -5,6 +5,12 @@ with lib; let cfg = config.services.pass-secret-service; + conflictingModules = [ "services.gnome-keyring" ]; + + moduleIsEnabled = v: config.${v}.enable or false; + hasConflicts = modulePathName: !(any moduleIsEnabled modulePathName); + getConflicts = filter moduleIsEnabled; + busName = "org.freedesktop.secrets"; in { meta.maintainers = with maintainers; [ cab404 cyntheticfox ]; @@ -20,10 +26,10 @@ in { defaultText = "$HOME/.password-store"; example = "/home/user/.local/share/password-store"; description = '' - Absolute path to password store. Defaults to - $HOME/.password-store if the - module is not enabled, and - if it is. + Absolute path to password store. Defaults to + $HOME/.password-store if the + module is not enabled, and + else. ''; }; }; @@ -33,11 +39,15 @@ in { (hm.assertions.assertPlatform "services.pass-secret-service" pkgs platforms.linux) { - assertion = !config.services.gnome-keyring.enable; + assertion = hasConflicts conflictingModules; message = '' Only one secrets service per user can be enabled at a time. Other services enabled: - - gnome-keyring + ''; } ];