From aa42f6678e2f279e0425a2d49defcda120815638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 18:02:45 +0200 Subject: [PATCH] :sparkles: rework email module --- hosts/nixos-desktop/default.nix | 6 ---- hosts/nixos-laptop/default.nix | 6 ---- modules/config/default.nix | 1 - modules/config/email.nix | 50 -------------------------------- modules/profiles/desktop.nix | 1 + modules/programs/default.nix | 1 + modules/programs/email.nix | 25 ++++++++++++++++ secrets/email-desktop.age | Bin 771 -> 0 bytes secrets/email-laptop.age | 15 ---------- secrets/secrets.nix | 2 -- 10 files changed, 27 insertions(+), 80 deletions(-) delete mode 100644 modules/config/email.nix create mode 100644 modules/programs/email.nix delete mode 100644 secrets/email-desktop.age delete mode 100644 secrets/email-laptop.age diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 9a1fa86..a3c800a 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -14,12 +14,6 @@ # KERNEL boot.kernelPackages = pkgs.linuxPackages_latest; - # MY MODULES - my.email = { - enable = true; - passwordFile = ../../secrets/email-desktop.age; - }; - # BOOT boot = { supportedFilesystems = [ "btrfs" "ntfs" ]; diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index f6012e9..22ca98f 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -11,12 +11,6 @@ ./hardware-configuration.nix ]; - # MY MODULES - my.email = { - enable = true; - passwordFile = ../../secrets/email-desktop.age; - }; - # BOOT boot = { supportedFilesystems = [ "btrfs" ]; diff --git a/modules/config/default.nix b/modules/config/default.nix index 2e34077..7312bcb 100644 --- a/modules/config/default.nix +++ b/modules/config/default.nix @@ -7,7 +7,6 @@ { imports = [ ./bin - ./email.nix ./nix.nix ./shell.nix ./theming diff --git a/modules/config/email.nix b/modules/config/email.nix deleted file mode 100644 index 0801a75..0000000 --- a/modules/config/email.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ config -, lib -, pkgs -, ... -}: - -with lib; -let - cfg = config.my.email; - name = "Moritz Böhme"; - email = "mail@moritzboeh.me"; - mailDirectory = "/home/moritz/.mail"; -in -{ - options.my.email = { - enable = mkOption { - default = false; - type = types.bool; - example = true; - }; - passwordFile = mkOption { - default = null; - type = types.path; - description = "File containing the email password."; - }; - }; - - config = mkIf cfg.enable { - # Protonbridge Setup - environment.systemPackages = with pkgs; [ protonmail-bridge ]; - systemd.user.services.protonmail-bridge = { - description = "Protonmail Bridge"; - enable = true; - script = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --log-level debug"; - path = [ - pkgs.gnome3.gnome-keyring - ]; # HACK: https://github.com/ProtonMail/proton-bridge/issues/176 - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; - }; - age.secrets.email = { - file = cfg.passwordFile; - owner = "1000"; - }; - - # Email Applications - home-manager.users.moritz.home.packages = with pkgs; [ thunderbird ]; - networking.firewall.allowedTCPPorts = [ 33728 1025 1143 ]; - }; -} diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 320beb0..f22621f 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -23,6 +23,7 @@ with lib; { bspwm.enable = true; code.enable = true; emacs.enable = true; + email.enable = true; firefox = { enable = true; arkenfox = { diff --git a/modules/programs/default.nix b/modules/programs/default.nix index bdc63b1..3033d19 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -11,6 +11,7 @@ ./code.nix ./direnv.nix ./emacs.nix + ./email.nix ./firefox.nix ./fish.nix ./git.nix diff --git a/modules/programs/email.nix b/modules/programs/email.nix new file mode 100644 index 0000000..4717780 --- /dev/null +++ b/modules/programs/email.nix @@ -0,0 +1,25 @@ +{ config +, lib +, pkgs +, ... +}: + +with lib; +let + cfg = config.my.programs.email; +in +{ + options.my.programs.email = { + enable = mkOption { + default = false; + type = types.bool; + example = true; + }; + }; + + config = mkIf cfg.enable { + # Email Applications + users.users.moritz.packages = with pkgs; [ thunderbird ]; + networking.firewall.allowedTCPPorts = [ 33728 1025 1143 ]; + }; +} diff --git a/secrets/email-desktop.age b/secrets/email-desktop.age deleted file mode 100644 index 3d5245b6f5b1417aab6580303e47bde280788ec9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 771 zcmZY6yQY+t zImQBBlZRp@^C~3>H9a0u;iZ(*tBRP*eyy4vRLoT}JIu@V7-EqKlSyYz+lr-~D1agG z7JGZHd)5k}l5bWqjD}`Ui8<}IW-dKBgZNTZZFp{n+g92NV8G|oX_`(d-LQu8G(3i$ z#y|n`Q;sk(Xau!LFgZnCy0Q;al#dMCa}{oi9m zs{!1K98D=Fe_!0z)?Uc2A+8W%w5S@%vKe=yXI8}T(ZP`pnE^M8UTg4{T;;%V6a`^T zm(jqG7f1z-2EQ~ z@BJ z{NJ1W@PTy2@qJiEeih-!&+gAd`G;Pmy|6ZP)q ssh-ed25519 CjuqfA 42ZhJgcVV9rxkVmvEj4aCeeVx4Tldtx2L54hS1mZCxE -dqSOKoGxChgMHmiY4SgoJqxH9nSGlLVnmbke2+xZHYA --> ssh-ed25519 QRYDmg yHGmTle30O7BQ7SFG7m5gaZctmwT26LNfJPbocs1WTM -lQZa4yp8R8UZpG+/JGuZ4z4gxlGXColGCs8qlKFyCP4 --> ssh-ed25519 wG6LYg wokwDVXoQaZlpX4qM/2OmSo9lbDFIqqg/dKesIETJBI -0MBgUClVsQksxRCa4WhSvQlzZRl673CZeeP7PVfHtCI --> ssh-ed25519 ZYd7Zg cGYmLN+nSv5NGR+HMbofhtzbmZ/LjftCpcUIbZ5Z+hY -3u9UgW7TDWX+dfuJuIwRxSkwTOLrUw1znEkU9ao5Ltw --> ssh-ed25519 as9VYQ dK/VaOUKsr58sTfiF3qjUPHi3mxfioW5IXkyMmx+xCY -mTF8kUni1pxBrcE+j4mHZx/Zs8D8SgqWjfRkDH66m5k --> Pzw,"-grease R`h7fZ+ 'U[<2@ `Ay6[ -3a6T ---- I5udQOeevThPQ3VGfarWDe+n1y1DnC1vNqd+hU53ENw - ǻ@C wWLous fzb+4 \ No newline at end of file diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 375fd0e..90e1b43 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -13,8 +13,6 @@ in { "nordvpn.age".publicKeys = all; "spotifyd.age".publicKeys = all; - "email-desktop.age".publicKeys = all; - "email-laptop.age".publicKeys = all; "home-vpn.age".publicKeys = all; "home-vpn-password.age".publicKeys = all; "github.age".publicKeys = all;