feat: add email integration with mu4e and protonmail-bridge
- Configure mu4e in Doom Emacs with Proton mail account - Add protonmail-bridge service and mbsync/msmtp for mail sync - Integrate sops-nix for secrets management (mail password) - Create mail.nix with full IMAP/SMTP configuration - Add ComfyUI user service module - Add custom ASCII banner for Doom dashboard - Enable nix module in Doom Emacs - Add force-quit gnome extension - Ignore secrets directory in git - also add comfy-ui
This commit is contained in:
parent
7f5ad94534
commit
0251529a8a
14 changed files with 220 additions and 22 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -9,7 +9,7 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
ehthumbs.db
|
ehthumbs.db
|
||||||
|
secrets
|
||||||
# === Editor Configs ===
|
# === Editor Configs ===
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
|
|
||||||
16
flake.lock
generated
16
flake.lock
generated
|
|
@ -201,14 +201,18 @@
|
||||||
"secrets": {
|
"secrets": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"path": "git@git.sr.ht/~sposito/secrets",
|
"lastModified": 1768616087,
|
||||||
"type": "path"
|
"narHash": "sha256-A/3XkeLfNCRUJYMa9f44VYsv6tWYuIMeDrra1J5GYqs=",
|
||||||
|
"ref": "refs/heads/main",
|
||||||
|
"rev": "d540ed7731df4e19a15afe810630e5c7786630c4",
|
||||||
|
"revCount": 3,
|
||||||
|
"type": "git",
|
||||||
|
"url": "ssh://git@git.sr.ht/~sposito/secrets"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "git@git.sr.ht/~sposito/secrets",
|
"type": "git",
|
||||||
"type": "path"
|
"url": "ssh://git@git.sr.ht/~sposito/secrets"
|
||||||
},
|
}
|
||||||
"parent": []
|
|
||||||
},
|
},
|
||||||
"sops-nix": {
|
"sops-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
secrets = {
|
secrets = {
|
||||||
url = "git@git.sr.ht/~sposito/secrets";
|
url = "git+ssh://git@git.sr.ht/~sposito/secrets";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -95,6 +95,7 @@
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
./home-manager/nixstation.nix
|
./home-manager/nixstation.nix
|
||||||
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@
|
||||||
emacsPackages.vterm
|
emacsPackages.vterm
|
||||||
emacsPackages.treemacs
|
emacsPackages.treemacs
|
||||||
emacsPackages.doom
|
emacsPackages.doom
|
||||||
|
emacsPackages.mu4e
|
||||||
|
mu
|
||||||
sbcl
|
sbcl
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
13
home-manager/emacs/doom/banner.txt
Normal file
13
home-manager/emacs/doom/banner.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
█████████ ███ █████
|
||||||
|
███░░░░░███ ░░░ ░░███
|
||||||
|
░███ ░░░ ████████ ██████ █████ ████ ███████ ██████
|
||||||
|
░░█████████ ░░███░░███ ███░░███ ███░░ ░░███ ░░░███░ ███░░███
|
||||||
|
░░░░░░░░███ ░███ ░███░███ ░███░░█████ ░███ ░███ ░███ ░███
|
||||||
|
███ ░███ ░███ ░███░███ ░███ ░░░░███ ░███ ░███ ███░███ ░███
|
||||||
|
░░█████████ ░███████ ░░██████ ██████ █████ ██ ░░█████ ░░██████
|
||||||
|
░░░░░░░░░ ░███░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░ ░░░░░ ░░░░░░
|
||||||
|
░███ ___ __ __ __ ___ __
|
||||||
|
█████ | __| V |/ \ / _//' _/
|
||||||
|
░░░░░ | _|| \_/ | /\ | \__`._`.
|
||||||
|
|___|_| |_|_||_|\__/|___/
|
||||||
|
|
@ -1,7 +1,18 @@
|
||||||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||||
|
;; Add NixOS mu4e to load-path
|
||||||
|
(let ((mu4e-dir (car (file-expand-wildcards "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-*"))))
|
||||||
|
(when mu4e-dir
|
||||||
|
(add-to-list 'load-path mu4e-dir)))
|
||||||
|
|
||||||
(add-hook 'scheme-mode-hook #'smartparens-strict-mode)
|
(add-hook 'scheme-mode-hook #'smartparens-strict-mode)
|
||||||
|
|
||||||
|
(defun my-doom-ascii-banner ()
|
||||||
|
(let ((banner-file (expand-file-name "banner.txt" doom-user-dir)))
|
||||||
|
(when (file-exists-p banner-file)
|
||||||
|
(insert-file-contents banner-file))))
|
||||||
|
|
||||||
|
(setq +doom-dashboard-ascii-banner-fn #'my-doom-ascii-banner)
|
||||||
|
|
||||||
(use-package! lsp-mode
|
(use-package! lsp-mode
|
||||||
:config
|
:config
|
||||||
(add-to-list 'lsp-language-id-configuration '(fennel-mode . "fennel"))
|
(add-to-list 'lsp-language-id-configuration '(fennel-mode . "fennel"))
|
||||||
|
|
@ -45,3 +56,22 @@
|
||||||
(map! :desc "Toggle terminal (vterm)"
|
(map! :desc "Toggle terminal (vterm)"
|
||||||
"C-~" #'vterm)
|
"C-~" #'vterm)
|
||||||
|
|
||||||
|
(after! mu4e
|
||||||
|
(setq mu4e-get-mail-command "mbsync -a"
|
||||||
|
mu4e-update-interval 300
|
||||||
|
mu4e-maildir "~/Maildir"
|
||||||
|
mu4e-change-filenames-when-moving t
|
||||||
|
sendmail-program "msmtp"
|
||||||
|
send-mail-function #'sendmail-send-it
|
||||||
|
message-sendmail-f-is-evil t
|
||||||
|
message-sendmail-extra-arguments '("--read-envelope-from")
|
||||||
|
message-send-mail-function #'message-send-mail-with-sendmail)
|
||||||
|
|
||||||
|
(set-email-account! "Proton"
|
||||||
|
'((mu4e-sent-folder . "/proton/Sent")
|
||||||
|
(mu4e-drafts-folder . "/proton/Drafts")
|
||||||
|
(mu4e-trash-folder . "/proton/Trash")
|
||||||
|
(mu4e-refile-folder . "/proton/Archive")
|
||||||
|
(user-mail-address . "th.spo@pm.me")
|
||||||
|
(user-full-name . "Thiago Sposito"))
|
||||||
|
t))
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
(eval +overlay) ; run code, run (also, repls)
|
(eval +overlay) ; run code, run (also, repls)
|
||||||
lookup ; navigate your code and its documentation
|
lookup ; navigate your code and its documentation
|
||||||
llm ; when I said you needed friends, I didn't mean...
|
llm ; when I said you needed friends, I didn't mean...
|
||||||
(lsp +peek)
|
lsp
|
||||||
;;(lsp +eglot) ; M-x vscode
|
;;(lsp +eglot) ; M-x vscode
|
||||||
magit ; a git porcelain for Emacs
|
magit ; a git porcelain for Emacs
|
||||||
;;make ; run make tasks from Emacs
|
;;make ; run make tasks from Emacs
|
||||||
|
|
@ -111,8 +111,8 @@
|
||||||
tree-sitter ; syntax and parsing, sitting in a tree...
|
tree-sitter ; syntax and parsing, sitting in a tree...
|
||||||
upload ; map local to remote projects via ssh/ftp
|
upload ; map local to remote projects via ssh/ftp
|
||||||
|
|
||||||
:os
|
; :os
|
||||||
(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
|
;(:if (featurep :system 'macos) macos) ; improve compatibility with macOS
|
||||||
;;tty ; improve the terminal Emacs experience
|
;;tty ; improve the terminal Emacs experience
|
||||||
|
|
||||||
:lang
|
:lang
|
||||||
|
|
@ -156,7 +156,7 @@
|
||||||
(lua +fennel +lsp) ; one-based indices? one-based indices
|
(lua +fennel +lsp) ; one-based indices? one-based indices
|
||||||
markdown ; writing docs for people to ignore
|
markdown ; writing docs for people to ignore
|
||||||
;;nim ; python + lisp at the speed of c
|
;;nim ; python + lisp at the speed of c
|
||||||
;;nix ; I hereby declare "nix geht mehr!"
|
nix ; I hereby declare "nix geht mehr!"
|
||||||
;;ocaml ; an objective camel
|
;;ocaml ; an objective camel
|
||||||
org ; organize your plain life in plain text
|
org ; organize your plain life in plain text
|
||||||
;;php ; perl's insecure younger brother
|
;;php ; perl's insecure younger brother
|
||||||
|
|
@ -183,11 +183,12 @@
|
||||||
;;zig ; C, but simpler
|
;;zig ; C, but simpler
|
||||||
|
|
||||||
:email
|
:email
|
||||||
;;(mu4e +org +gmail)
|
(mu4e +mbsync +org)
|
||||||
|
|
||||||
;;notmuch
|
;;notmuch
|
||||||
;;(wanderlust +gmail)
|
;;(wanderlust +gmail)
|
||||||
|
|
||||||
:app:
|
:app
|
||||||
;;calendar
|
;;calendar
|
||||||
;;emms
|
;;emms
|
||||||
;;everywhere ; *leave* Emacs!? You must be joking
|
;;everywhere ; *leave* Emacs!? You must be joking
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
gnome-tweaks
|
gnome-tweaks
|
||||||
gnomeExtensions.appindicator
|
gnomeExtensions.appindicator
|
||||||
|
gnomeExtensions.force-quit
|
||||||
gnomeExtensions.forge
|
gnomeExtensions.forge
|
||||||
gnomeExtensions.gsconnect
|
gnomeExtensions.gsconnect
|
||||||
gnomeExtensions.pop-shell
|
gnomeExtensions.pop-shell
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
inputs,
|
inputs,
|
||||||
|
sops,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -25,7 +26,9 @@ in
|
||||||
./gnome
|
./gnome
|
||||||
./icons.nix
|
./icons.nix
|
||||||
./nvim
|
./nvim
|
||||||
|
./services
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
|
./mail.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
|
|
@ -77,6 +80,7 @@ in
|
||||||
pandoc
|
pandoc
|
||||||
pinentry-curses
|
pinentry-curses
|
||||||
podman
|
podman
|
||||||
|
protonmail-bridge
|
||||||
python3
|
python3
|
||||||
racket
|
racket
|
||||||
ripgrep
|
ripgrep
|
||||||
|
|
@ -163,19 +167,34 @@ in
|
||||||
background_opacity = 1.0;
|
background_opacity = 1.0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
mbsync.enable = true;
|
||||||
vscode = {
|
vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.gpg-agent = {
|
services = {
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
pinentry.package = pkgs.pinentry-curses;
|
|
||||||
};
|
|
||||||
|
|
||||||
#systemd.user.startServices = "sd-switch";
|
gpg-agent = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
pinentry.package = pkgs.pinentry-curses;
|
||||||
|
};
|
||||||
|
|
||||||
|
protonmail-bridge = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = [
|
||||||
|
pkgs.gnome-keyring
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
sops = {
|
||||||
|
gnupg.home = "/home/thiago/.gnupg";
|
||||||
|
age.keyFile = null; # We are using the Nitrokey (PGP) instead
|
||||||
|
};
|
||||||
|
#systemd.user.startServices = "sd-switch";
|
||||||
home.stateVersion = "25.11";
|
home.stateVersion = "25.11";
|
||||||
|
|
||||||
# sops configuration
|
# sops configuration
|
||||||
|
|
|
||||||
58
home-manager/mail.nix
Normal file
58
home-manager/mail.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
sops,
|
||||||
|
secrets,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
sops.secrets = {
|
||||||
|
"mailpass" = {
|
||||||
|
sopsFile = secrets.outPath + "/mail.yaml";
|
||||||
|
key = "password";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts.proton = {
|
||||||
|
primary = true;
|
||||||
|
address = "th.spo@pm.me";
|
||||||
|
userName = "thiago@sposito.ch";
|
||||||
|
realName = "Thiago Sposito";
|
||||||
|
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets.mailpass.path}";
|
||||||
|
imap = {
|
||||||
|
host = "127.0.0.1";
|
||||||
|
port = 1143;
|
||||||
|
tls.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
smtp = {
|
||||||
|
host = "127.0.0.1";
|
||||||
|
port = 1025;
|
||||||
|
tls.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
mbsync = {
|
||||||
|
enable = true;
|
||||||
|
create = "maildir";
|
||||||
|
expunge = "both";
|
||||||
|
extraConfig.account = {
|
||||||
|
SSLType = "STARTTLS";
|
||||||
|
TLSType = "STARTTLS";
|
||||||
|
CertificateFile = "~/.config/protonmail/bridge-v3/cert.pem";
|
||||||
|
AuthMechs = "LOGIN";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
msmtp = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = {
|
||||||
|
tls_starttls = "on";
|
||||||
|
tls_certcheck = "off";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.mbsync.enable = true;
|
||||||
|
programs.msmtp.enable = true;
|
||||||
|
programs.mu.enable = true;
|
||||||
|
}
|
||||||
61
home-manager/services/comfy-ui.nix
Normal file
61
home-manager/services/comfy-ui.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
{ pkgs, config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
comfyuiSrc = pkgs.fetchFromGitHub {
|
||||||
|
owner = "Comfy-Org";
|
||||||
|
repo = "ComfyUI";
|
||||||
|
rev = "master";
|
||||||
|
sha256 = "PQfZ0PD/PQn49ElGdzt/El8JrU7clETcLi/6ZUxm8f8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dataDir = "${config.home.homeDirectory}/.local/share/comfyui";
|
||||||
|
venvDir = "${dataDir}/.venv";
|
||||||
|
|
||||||
|
startScript = pkgs.writeShellScript "comfyui-start" ''
|
||||||
|
set -e
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.zlib}/lib:${pkgs.libGL}/lib:/run/opengl-driver/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
|
mkdir -p ${dataDir}
|
||||||
|
|
||||||
|
# Copy source if not exists or update
|
||||||
|
if [ ! -f "${dataDir}/main.py" ]; then
|
||||||
|
cp -r ${comfyuiSrc}/* ${dataDir}/
|
||||||
|
chmod -R u+w ${dataDir}
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ${dataDir}
|
||||||
|
|
||||||
|
# Create venv on first run
|
||||||
|
if [ ! -d "${venvDir}" ]; then
|
||||||
|
${pkgs.python313}/bin/python -m venv ${venvDir}
|
||||||
|
${venvDir}/bin/pip install --upgrade pip
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Always ensure deps are installed
|
||||||
|
if [ ! -f "${venvDir}/.deps-installed" ]; then
|
||||||
|
${venvDir}/bin/pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124
|
||||||
|
${venvDir}/bin/pip install -r requirements.txt
|
||||||
|
touch ${venvDir}/.deps-installed
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec ${venvDir}/bin/python main.py "$@"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home.packages = [ pkgs.python313 pkgs.git ];
|
||||||
|
|
||||||
|
systemd.user.services.comfy-ui = {
|
||||||
|
Unit = {
|
||||||
|
Description = "ComfyUI";
|
||||||
|
After = [ "network.target" ];
|
||||||
|
};
|
||||||
|
Service = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${startScript}";
|
||||||
|
Restart = "on-failure";
|
||||||
|
Environment = [ "CUDA_VISIBLE_DEVICES=0" ];
|
||||||
|
};
|
||||||
|
Install.WantedBy = [ "default.target" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
7
home-manager/services/default.nix
Normal file
7
home-manager/services/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./comfy-ui.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
security.pki.certificateFiles = [ "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ];
|
||||||
services = {
|
services = {
|
||||||
opensnitch = {
|
opensnitch = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,5 @@ in
|
||||||
packages = [ pkgs.home-manager ];
|
packages = [ pkgs.home-manager ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue