selfprivacy-nixos-config/sp-modules/nextcloud/cleanup-module.nix

20 lines
559 B
Nix
Raw Permalink Normal View History

{ 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!"
)
''
2023-11-29 04:19:04 +00:00
rm -f -v ${db-pass-filepath}
rm -f -v ${admin-pass-filepath}
'';
};
}