pass-secret-service: Fix default info, modularize conflict checks
Signed-off-by: Cynthia Fox <cyntheticfox@gh0st.sh>
This commit is contained in:
parent
4620e68b19
commit
851df4fe49
|
@ -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 ];
|
||||
|
@ -23,7 +29,7 @@ in {
|
|||
Absolute path to password store. Defaults to
|
||||
<filename>$HOME/.password-store</filename> if the
|
||||
<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
|
||||
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
|
||||
<ul>
|
||||
${map (v: ''
|
||||
<li><option>${v}</option></li>
|
||||
'') (getConflicts conflictingModules)}
|
||||
</ul>
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue