fix nextcloud (case when enabled)
Previously, second mkIf for cleanup case took precedence when merge with `//`. Now it's 2 modules: one for selfprivacy.modules.nextcloud.enable == true, another for selfprivacy.modules.nextcloud.enable == false.
This commit is contained in:
19
sp-modules/nextcloud/cleanup-module.nix
Normal file
19
sp-modules/nextcloud/cleanup-module.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (import ./common.nix config) sp db-pass-filepath admin-pass-filepath;
|
||||
in
|
||||
# FIXME do we really want to delete passwords on module deactivation!?
|
||||
{
|
||||
config = lib.mkIf (!sp.modules.nextcloud.enable) {
|
||||
system.activationScripts.nextcloudSecrets =
|
||||
lib.trivial.warn
|
||||
(
|
||||
"nextcloud service is disabled, " +
|
||||
"${db-pass-filepath} and ${admin-pass-filepath} will be removed!"
|
||||
)
|
||||
''
|
||||
rm -f ${db-pass-filepath}
|
||||
rm -f ${admin-pass-filepath}
|
||||
'';
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user