diff --git a/flake.nix b/flake.nix index a69d787..43b064a 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + mail = { + url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + hyprland = { url = "github:hyprwm/Hyprland"; }; @@ -85,6 +90,7 @@ outputs = { nixpkgs, agenix, + mail, homeManager, site, themes, @@ -169,6 +175,7 @@ agenix.nixosModules.default ./secrets + mail.nixosModules.default site.nixosModules.default defaultConfiguration diff --git a/hosts/cube/acme.nix b/hosts/cube/acme.nix index 5b590f2..ef74d02 100644 --- a/hosts/cube/acme.nix +++ b/hosts/cube/acme.nix @@ -12,7 +12,7 @@ serverSystemConfiguration { credentialsFile = config.age.secrets.acme.path; dnsProvider = "cloudflare"; dnsResolver = "1.1.1.1"; - email = "rgbsphere@gmail.com"; + email = "security@rgbcu.be"; group = "nginx"; }; diff --git a/hosts/cube/akkoma.nix b/hosts/cube/akkoma.nix index ccfff53..bc5ad08 100644 --- a/hosts/cube/akkoma.nix +++ b/hosts/cube/akkoma.nix @@ -1,6 +1,6 @@ { config, ulib, ... }: with ulib; -systemConfiguration { +serverSystemConfiguration { services.akkoma = let inherit ((pkgs.formats.elixirConf { }).lib) mkRaw mkTuple; @@ -28,8 +28,8 @@ systemConfiguration { name = "RGBCube's Akkoma Server"; description = "RGBCube's Akkoma server, facism edition."; - email = "rgbsphere@gmail.com"; - notify_email = "rgbsphere@gmail.com"; + email = "social@rgbcu.be"; + notify_email = "social@rgbcu.be"; limit = 100000; remote_limit = 100000; diff --git a/hosts/cube/mail.nix b/hosts/cube/mail.nix new file mode 100644 index 0000000..9736ac3 --- /dev/null +++ b/hosts/cube/mail.nix @@ -0,0 +1,20 @@ +{ config, ulib, ... }: with ulib; + +serverSystemConfiguration { + mailserver = enabled { + domains = [ config.networking.domain ]; + fqdn = "mail.${config.networking.domain}"; + + certificateScheme = "acme"; + + hierarchySeparator = "/"; + useFsLayout = true; + + loginAccounts.contact = { + name = "contact@${config.networking.domain}"; + aliases = [ "@${config.networking.domain}" ]; + + hashedPasswordFile = config.age.secrets."cube.mail.password.hash".path; + }; + }; +} diff --git a/secrets/cube.mail.password.hash.age b/secrets/cube.mail.password.hash.age new file mode 100644 index 0000000..8cd11fd Binary files /dev/null and b/secrets/cube.mail.password.hash.age differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 511f299..1e9ca60 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -1,9 +1,10 @@ with import ./keys.nix; { - "acme.age".publicKeys = [ cube ]; - "cube.password.age".publicKeys = [ cube ]; - "cube.id.age".publicKeys = [ rgbcube ]; - "enka.said.password.age".publicKeys = [ rgbcube ]; - "enka.orhan.password.age".publicKeys = [ rgbcube ]; + "acme.age".publicKeys = [ cube ]; + "cube.password.age".publicKeys = [ cube ]; + "cube.mail.password.hash.age".publicKeys = [ cube ]; + "cube.id.age".publicKeys = [ rgbcube ]; + "enka.said.password.age".publicKeys = [ rgbcube ]; + "enka.orhan.password.age".publicKeys = [ rgbcube ]; }