From 84069e1527545a5059d8ed20b711c95fb52eafe8 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Thu, 13 Apr 2023 19:32:57 -0700 Subject: [PATCH] switched from hosted mailserver to gmail aliases --- flake.lock | 103 ++++++++++++++++++++++++++++++++- flake.nix | 5 +- hosts/Alaska/default.nix | 7 +-- hosts/Alaska/modules/msmtp.nix | 21 +++++++ 4 files changed, 129 insertions(+), 7 deletions(-) create mode 100644 hosts/Alaska/modules/msmtp.nix diff --git a/flake.lock b/flake.lock index fe5597a..b37d954 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,37 @@ { "nodes": { + "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" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -57,6 +89,21 @@ "type": "github" } }, + "nixpkgs-22_11": { + "locked": { + "lastModified": 1669558522, + "narHash": "sha256-yqxn+wOiPqe6cxzOo4leeJOp1bXE/fjPEi/3F/bBHv8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ce5fe99df1f15a09a91a86be9738d68fadfbad82", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-22.11", + "type": "indirect" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1678898370, @@ -73,11 +120,50 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1670751203, + "narHash": "sha256-XdoH1v3shKDGlrwjgrNX/EN8s3c+kQV7xY6cLCE8vcI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64e0bf055f9d25928c31fb12924e59ff8ce71e60", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, "root": { "inputs": { "home-manager": "home-manager", "kmonad": "kmonad", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "simple-nixos-mailserver": "simple-nixos-mailserver" + } + }, + "simple-nixos-mailserver": { + "inputs": { + "blobs": "blobs", + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs_3", + "nixpkgs-22_11": "nixpkgs-22_11", + "utils": "utils_2" + }, + "locked": { + "lastModified": 1671738303, + "narHash": "sha256-PRgqtaWf2kMSYqVmcnmhTh+UsC0RmvXRTr+EOw5VZUA=", + "owner": "simple-nixos-mailserver", + "repo": "nixos-mailserver", + "rev": "6d0d9fb966cc565a3df74d3b686f924c7615118c", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "ref": "master", + "repo": "nixos-mailserver", + "type": "gitlab" } }, "utils": { @@ -94,6 +180,21 @@ "repo": "flake-utils", "type": "github" } + }, + "utils_2": { + "locked": { + "lastModified": 1605370193, + "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5021eac20303a61fafe17224c087f5519baed54d", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 0b604fd..941d9c9 100644 --- a/flake.nix +++ b/flake.nix @@ -9,9 +9,11 @@ }; kmonad.url = "github:kmonad/kmonad?dir=nix"; + simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; + }; - outputs = inputs@{ self, nixpkgs, home-manager, kmonad }: + outputs = inputs@{ self, nixpkgs, home-manager, kmonad, simple-nixos-mailserver, ... }: let user = "nixolas"; system = "x86_64-linux"; @@ -31,6 +33,7 @@ specialArgs = { inherit user; }; modules = [ + simple-nixos-mailserver.nixosModule { networking.hostName = "Alaska"; } diff --git a/hosts/Alaska/default.nix b/hosts/Alaska/default.nix index 5a73ef5..2523b23 100644 --- a/hosts/Alaska/default.nix +++ b/hosts/Alaska/default.nix @@ -5,8 +5,9 @@ { imports = [ (import ./hardware-configuration.nix) - (import ./modules/nginx.nix) + (import ./modules/nginx.nix) (import ./modules/nextcloud.nix) + (import ./modules/msmtp.nix) ]; environment.systemPackages = [ @@ -52,10 +53,6 @@ }; }; - - programs.msmtp = { - enable = true; - }; environment.etc."mdadm.conf".text = '' MAILADDR nicholasyoungsumner@gmail.com ''; diff --git a/hosts/Alaska/modules/msmtp.nix b/hosts/Alaska/modules/msmtp.nix new file mode 100644 index 0000000..0a51dbf --- /dev/null +++ b/hosts/Alaska/modules/msmtp.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: + +{ + + programs.msmtp = { + enable = true; + setSendmail = true; + accounts = { + default = { + host = "smtp.gmail.com"; + port = 587; + tls = true; + tls_starttls = true; + auth = true; + from = "noreply@nickiel.net"; + user = "nickiel.is.a.dev"; + passwordeval = "cat /Aurora/mail.password"; + }; + }; + }; +}