mail.nix (548B)
1 { config, lib, pkgs, ... }: 2 3 with lib; 4 let 5 cfg = config.profiles.mail; 6 secretPath = ../../../secrets/machines.nix; 7 secretCondition = (builtins.pathExists secretPath); 8 in 9 { 10 options = { 11 profiles.mail = { 12 enable = mkOption { 13 default = true; 14 description = "Enable mail profile"; 15 type = types.bool; 16 }; 17 }; 18 }; 19 config = mkIf (cfg.enable && secretCondition) { 20 environment.etc."msmtprc".source = pkgs.mkSecret ../../../secrets/msmtprc; 21 environment.systemPackages = with pkgs; [ msmtp ]; 22 }; 23 }