diff --git a/flake.lock b/flake.lock index c90563d..868326c 100644 --- a/flake.lock +++ b/flake.lock @@ -24,6 +24,22 @@ "type": "github" } }, + "blobs": { + "flake": false, + "locked": { + "lastModified": 1604995301, + "narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=", + "owner": "simple-nixos-mailserver", + "repo": "blobs", + "rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "repo": "blobs", + "type": "gitlab" + } + }, "colmena": { "inputs": { "flake-compat": "flake-compat", @@ -68,7 +84,7 @@ "inputs": { "flake-compat": "flake-compat_2", "nixpkgs": "nixpkgs_3", - "utils": "utils_4" + "utils": "utils_5" }, "locked": { "lastModified": 1648475189, @@ -464,12 +480,35 @@ "type": "indirect" } }, + "mailserver": { + "inputs": { + "blobs": "blobs", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-22_05": "nixpkgs-22_05", + "utils": "utils_3" + }, + "locked": { + "lastModified": 1658267644, + "narHash": "sha256-NJRe1rnlF112eZwxNASlRL8/ghwD8g+lpHIYRkWQxC8=", + "owner": "simple-nixos-mailserver", + "repo": "nixos-mailserver", + "rev": "004c229ca44c069d93c92abf67ff1619fb508c6a", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "repo": "nixos-mailserver", + "type": "gitlab" + } + }, "minecraft-servers": { "inputs": { "nixpkgs": [ "nixpkgs" ], - "utils": "utils_3" + "utils": "utils_4" }, "locked": { "lastModified": 1663552861, @@ -581,6 +620,21 @@ "type": "github" } }, + "nixpkgs-22_05": { + "locked": { + "lastModified": 1654936503, + "narHash": "sha256-soKzdhI4jTHv/rSbh89RdlcJmrPgH8oMb/PLqiqIYVQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dab6df51387c3878cdea09f43589a15729cae9f4", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-22.05", + "type": "indirect" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1663746095, @@ -730,6 +784,7 @@ "home-manager": "home-manager", "hyprland": "hyprland", "hyprpaper": "hyprpaper", + "mailserver": "mailserver", "minecraft-servers": "minecraft-servers", "nixpkgs": "nixpkgs_2", "riff": "riff", @@ -844,6 +899,21 @@ } }, "utils_3": { + "locked": { + "lastModified": 1605370193, + "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5021eac20303a61fafe17224c087f5519baed54d", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_4": { "inputs": { "flake-utils": "flake-utils_2" }, @@ -861,7 +931,7 @@ "type": "github" } }, - "utils_4": { + "utils_5": { "locked": { "lastModified": 1648297722, "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", diff --git a/flake.nix b/flake.nix index c8a5f61..ce1b0e3 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,9 @@ riff.inputs.nixpkgs.follows = "nixpkgs"; webcord.url = "github:fufexan/webcord-flake"; + + mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; + mailserver.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = diff --git a/nixos/hosts/olympus/default.nix b/nixos/hosts/olympus/default.nix index 56dc527..25d537f 100644 --- a/nixos/hosts/olympus/default.nix +++ b/nixos/hosts/olympus/default.nix @@ -86,9 +86,11 @@ ip = "10.42.42.17"; mac = "0A:06:5E:E7:9A:0C"; } - # { - # ip = "10.42.42.18"; - # } + { + hostname = "mailserver"; + ip = "10.42.42.18"; + mac = "AA:F2:3D:5E:B3:40"; + } { hostname = "victoriametrics"; ip = "10.42.42.19"; diff --git a/nixos/hosts/olympus/mailserver/configuration.nix b/nixos/hosts/olympus/mailserver/configuration.nix new file mode 100644 index 0000000..3a3cbe4 --- /dev/null +++ b/nixos/hosts/olympus/mailserver/configuration.nix @@ -0,0 +1,30 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = [ ]; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.11"; # Did you read the comment? + + # Additional packages + environment.systemPackages = with pkgs; [ ]; + + networking.firewall.allowedTCPPorts = [ ]; + + mailserver = { + enable = false; + fqdn = "mail.0x76.dev"; + domains = [ "0x76.dev" ]; + + certificateScheme = 3; + }; +} diff --git a/nixos/hosts/olympus/nginx/configuration.nix b/nixos/hosts/olympus/nginx/configuration.nix index a78bdf8..02f6a52 100644 --- a/nixos/hosts/olympus/nginx/configuration.nix +++ b/nixos/hosts/olympus/nginx/configuration.nix @@ -49,7 +49,7 @@ in modules = with pkgs.nginxModules; [ brotli ]; }; - # Reverse Proxies + # 0x76.dev virtualHosts."ha.0x76.dev" = proxy "http://home-assistant.olympus:8123/"; virtualHosts."zookeeper-dev.0x76.dev" = proxy "http://eevee.olympus:8085/"; virtualHosts."md.0x76.dev" = proxy "http://hedgedoc.olympus:3000/"; @@ -57,6 +57,9 @@ in virtualHosts."o.0x76.dev" = proxy "http://minio.olympus:9000"; virtualHosts."grafana.0x76.dev" = proxy "http://victoriametrics.olympus:2342"; virtualHosts."outline.0x76.dev" = proxy "http://outline.olympus:3000"; + # virtualHosts."mail.0x76.dev" = proxy "http://mailserver.olympus:80"; + + # Redshifts virtualHosts."andreea.redshifts.xyz" = proxy "http://zmeura.olympus:8008"; # Meow diff --git a/util.nix b/util.nix index 3ac4ea7..78c9d65 100644 --- a/util.nix +++ b/util.nix @@ -1,4 +1,4 @@ -{ nixpkgs, home-manager, hyprland, ... }: +{ nixpkgs, home-manager, hyprland, mailserver, ... }: let inherit (nixpkgs) lib; inherit (builtins) filter mapAttrs attrValues concatLists; @@ -16,6 +16,7 @@ let ]; }; resolve_imports = { hostname, realm, profile ? hostname, type ? "lxc", ... }: [ + mailserver.nixosModules.mailserver ./nixos/common "${./.}/nixos/hosts/${realm}/${profile}/configuration.nix" ] ++ import_cases.${type};