1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

pass-secret-service: Fix default info, modularize conflict checks

Signed-off-by: Cynthia Fox <cyntheticfox@gh0st.sh>
This commit is contained in:
Cynthia Fox 2023-05-07 16:25:29 -04:00
parent 4620e68b19
commit 851df4fe49
No known key found for this signature in database
GPG key ID: 5960278CE235F821

View file

@ -5,6 +5,12 @@ with lib;
let let
cfg = config.services.pass-secret-service; 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"; busName = "org.freedesktop.secrets";
in { in {
meta.maintainers = with maintainers; [ cab404 cyntheticfox ]; meta.maintainers = with maintainers; [ cab404 cyntheticfox ];
@ -23,7 +29,7 @@ in {
Absolute path to password store. Defaults to Absolute path to password store. Defaults to
<filename>$HOME/.password-store</filename> if the <filename>$HOME/.password-store</filename> if the
<option>programs.password-store</option> module is not enabled, and <option>programs.password-store</option> module is not enabled, and
<option>programs.password-store.PASSWORD_STORE_DIR</option> if it is. <option>programs.password-store.settings.PASSWORD_STORE_DIR</option> else.
''; '';
}; };
}; };
@ -33,11 +39,15 @@ in {
(hm.assertions.assertPlatform "services.pass-secret-service" pkgs (hm.assertions.assertPlatform "services.pass-secret-service" pkgs
platforms.linux) platforms.linux)
{ {
assertion = !config.services.gnome-keyring.enable; assertion = hasConflicts conflictingModules;
message = '' message = ''
Only one secrets service per user can be enabled at a time. Only one secrets service per user can be enabled at a time.
Other services enabled: Other services enabled:
- gnome-keyring <ul>
${map (v: ''
<li><option>${v}</option></li>
'') (getConflicts conflictingModules)}
</ul>
''; '';
} }
]; ];