This repository has been archived on 2024-07-08. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config-tn/nixos/hosts/common/optional/maddy.nix

23 lines
486 B
Nix
Raw Normal View History

2024-03-18 20:26:02 +11:00
{ inputs
, outputs
, config
, ...
2024-03-18 08:04:32 +11:00
}: {
2024-03-17 13:31:36 +11:00
# init secret
2024-03-17 20:43:37 +11:00
config.sops.secrets."system/mail/maddy/envFile" = {
sopsFile = ./maddy.sops.yaml;
owner = "maddy";
group = "maddy";
};
2024-03-17 13:31:36 +11:00
2024-03-17 21:47:39 +11:00
# Restart dnscrypt when secret changes
2024-03-18 20:26:02 +11:00
config.sops.secrets."system/mail/maddy/envFile".restartUnits = [ "maddy" ];
2024-03-17 21:47:39 +11:00
2024-03-18 08:04:32 +11:00
#
2024-03-17 20:43:37 +11:00
config.services.maddy = {
2024-03-17 13:31:36 +11:00
enable = true;
2024-03-18 20:26:02 +11:00
secrets = [ config.sops.secrets."system/mail/maddy/envFile".path ];
2024-03-17 20:43:37 +11:00
config = builtins.readFile ./maddy.conf;
2024-03-17 13:31:36 +11:00
};
}