diff options
author | Soispha <soispha@vhack.eu> | 2023-07-03 15:10:14 +0200 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-07-03 15:12:58 +0200 |
commit | dacf980342f91654768a37926b23633846d8bb2f (patch) | |
tree | 9dca8583e1616ee836fd78744632d3eeee7f48b5 | |
parent | Fix(system/services/openssh): Rename to 'openssh' as the 'd' is a typo (diff) | |
download | nixos-server-dacf980342f91654768a37926b23633846d8bb2f.tar.gz nixos-server-dacf980342f91654768a37926b23633846d8bb2f.zip |
Refactor(system/services/mail): Move mail to services as it's one
-rw-r--r-- | flake.nix | 3 | ||||
-rw-r--r-- | system/mail/default.nix | 40 | ||||
-rw-r--r-- | system/mail/users.nix | bin | 486 -> 0 bytes | |||
-rw-r--r-- | system/services/mail/default.nix | 42 | ||||
-rw-r--r-- | system/services/mail/users.nix | 16 |
5 files changed, 58 insertions, 43 deletions
diff --git a/flake.nix b/flake.nix index 644fa4b..0cf5609 100644 --- a/flake.nix +++ b/flake.nix @@ -48,9 +48,6 @@ modules = [ ./hosts/server1/configuration.nix simple-nixos-mailserver.nixosModule - { - mailserver = import ./system/mail {inherit (pkgs) lib;}; - } disko.nixosModules.default impermanence.nixosModules.impermanence ]; diff --git a/system/mail/default.nix b/system/mail/default.nix deleted file mode 100644 index 1086f6e..0000000 --- a/system/mail/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -# vim: ts=2 -{lib, ...}: let - all_admins = [ - "sils@vhack.eu" - "soispha@vhack.eu" - "nightingale@vhack.eu" - ]; - users = import ./users.nix {}; -in - lib.recursiveUpdate { - enable = true; - fqdn = "server1.vhack.eu"; - - useFsLayout = true; - - extraVirtualAliases = { - "abuse@vhack.eu" = all_admins; - "postmaster@vhack.eu" = all_admins; - "admin@vhack.eu" = all_admins; - }; - - mailDirectory = "/srv/mail/vmail"; - dkimKeyDirectory = "/srv/mail/dkim"; - sieveDirectory = "/srv/mail/sieve"; - backup.snapshotRoot = "/srv/mail/backup"; - - enableImap = false; - enableImapSsl = true; - enablePop3 = false; - enablePop3Ssl = true; - # SMTP - enableSubmission = false; - enableSubmissionSsl = true; - openFirewall = true; - - keyFile = "/var/lib/acme/server1.vhack.eu/key.pem"; - certificateScheme = "acme"; - certificateFile = "/var/lib/acme/server1.vhack.eu/fullchain.pem"; - } - users diff --git a/system/mail/users.nix b/system/mail/users.nix deleted file mode 100644 index f3264a1..0000000 --- a/system/mail/users.nix +++ /dev/null Binary files differdiff --git a/system/services/mail/default.nix b/system/services/mail/default.nix new file mode 100644 index 0000000..f9d00ea --- /dev/null +++ b/system/services/mail/default.nix @@ -0,0 +1,42 @@ +{lib, ...}: let + all_admins = [ + "sils@vhack.eu" + "soispha@vhack.eu" + "nightingale@vhack.eu" + ]; + users = import ./users.nix {}; +in { + mailserver = + lib.recursiveUpdate { + enable = true; + fqdn = "server1.vhack.eu"; + + useFsLayout = true; + + extraVirtualAliases = { + "abuse@vhack.eu" = all_admins; + "postmaster@vhack.eu" = all_admins; + "admin@vhack.eu" = all_admins; + }; + + mailDirectory = "/srv/mail/vmail"; + dkimKeyDirectory = "/srv/mail/dkim"; + sieveDirectory = "/srv/mail/sieve"; + backup.snapshotRoot = "/srv/mail/backup"; + + enableImap = false; + enableImapSsl = true; + enablePop3 = false; + enablePop3Ssl = true; + # SMTP + enableSubmission = false; + enableSubmissionSsl = true; + openFirewall = true; + + keyFile = "/var/lib/acme/server1.vhack.eu/key.pem"; + certificateScheme = "acme"; + certificateFile = "/var/lib/acme/server1.vhack.eu/fullchain.pem"; + } + users; +} +# vim: ts=2 diff --git a/system/services/mail/users.nix b/system/services/mail/users.nix new file mode 100644 index 0000000..47b80fb --- /dev/null +++ b/system/services/mail/users.nix @@ -0,0 +1,16 @@ +{...}: { + # vhack.eu {{{ + domains = ["vhack.eu"]; + loginAccounts = { + "sils@vhack.eu" = { + hashedPassword = "$2b$05$RW/Svgk7iGxvP5W7ZwUZ1e.a3fj4fteevb2MtfFYYD0d1DQ17y9Fm"; + }; + "soispha@vhack.eu" = { + hashedPassword = "$2b$05$XX36sJuHNbTFvi8DFldscOeQBHahluSkiUqD9QGzQaET7NJusSuQW"; + }; + "nightingale@vhack.eu" = { + hashedPassword = "$2b$05$THIS_PASSWORD_HASH_IS_NOT_REAL,_PLEASE_CHANGE_IT_..._"; # TODO change + }; + }; + #}}} +} |