summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--home/default.nix3
-rw-r--r--home/mail/default.nix160
-rw-r--r--home/pim/.gitignore (renamed from home/mail/.gitignore)0
-rw-r--r--home/pim/default.nix6
-rw-r--r--home/pim/mail.nix (renamed from home/mail/sieve/mail.sieve)0
-rw-r--r--home/pim/sieve/mail.sieve1
-rw-r--r--home/pim/syncthing.nix (renamed from home/syncthing/default.nix)0
7 files changed, 8 insertions, 162 deletions
diff --git a/home/default.nix b/home/default.nix
index 38dbb60..f40fa6e 100644
--- a/home/default.nix
+++ b/home/default.nix
@@ -7,7 +7,6 @@
./desktop
./environ
./isolation
- ./mail
- ./syncthing
+ ./pim
];
}
diff --git a/home/mail/default.nix b/home/mail/default.nix
deleted file mode 100644
index f070b2f..0000000
--- a/home/mail/default.nix
+++ /dev/null
@@ -1,160 +0,0 @@
-{ config, lib, pkgs, ... }:
-with lib; let
- cfg = config.local.mail;
-in
-{
- options.local.mail = with types; {
- enable = mkEnableOption "mail";
-
- address = mkOption {
- type = str;
- };
-
- realName = mkOption {
- type = str;
- };
-
- sieve.enable = mkEnableOption "sieve filter";
- };
-
- config = mkIf cfg.enable {
- accounts.email = {
- maildirBasePath = "mail";
-
- accounts = {
- google = {
- address = "alejandrosotochacon@gmail.com";
- userName = "alejandrosotochacon"; # Ver salida de: msmtp --configure alejandrosotochacon@gmail.com
- inherit (config.local.mail) realName;
-
- maildir = null;
-
- msmtp.enable = true;
-
- passwordCommand = "pass show `hostname -s`/psk/gmail";
-
- smtp = {
- host = "smtp.gmail.com";
-
- tls = {
- enable = true;
- useStartTls = true;
- };
- };
- };
-
- local = {
- address = "${config.local.mail.address}@34project.org";
- userName = "${config.local.mail.address}@34project.org";
- inherit (config.local.mail) realName;
-
- primary = true;
-
- # ${maildirBasePath}/${maildir.path}
- maildir.path = "";
- folders.inbox = "";
-
- msmtp = {
- enable = true;
-
- extraConfig = {
- # con nixpkgs#gnutls: p11tool --login --list-privkeys
- auth = "off";
- tls_key_file = "pkcs11:serial=26902048;id=%01";
- tls_cert_file = "${config.local.pki.byPath."root.mail.larsa".cert}";
-
- passwordeval = "${pkgs.writeShellScript "read-yk-piv-pin" ''
- echo -e 'GETPIN\n' | \
- ${getExe config.services.gpg-agent.pinentryPackage} | \
- sed -nr '0,/^D (.+)/s//\1/p'
- ''}";
- };
- };
-
- neomutt.enable = true;
-
- imap = {
- host = "badhost"; # Evaluación de home falla sin esto, revisar si ya lo arreglaron
-
- tls = {
- enable = false;
- useStartTls = false;
- };
- };
-
- smtp = {
- host = "smtp.34project.org";
-
- tls = {
- enable = true;
- useStartTls = false;
- };
- };
- };
- };
- };
-
- programs = {
- msmtp.enable = true;
-
- neomutt = {
- enable = true;
- vimKeys = true;
-
- settings = {
- record = "+.sent";
- postponed = "+.drafts";
-
- use_threads = "flat";
- index_format = "'%4C %Z %<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> %-15.15L (%?l?%4l&%4c?) %s'";
- };
-
- extraConfig = ''
- auto_view text/html
- alternative_order text/plain text/enriched text/html
-
- reply-hook '~t ^alejandrosotochacon@gmail\.com$' 'my_hdr From: Alejandro Soto <alejandrosotochacon@gmail.com>'
- reply-hook '~t ^soto@exdev\.io$' 'my_hdr From: Alejandro Soto <soto@exdev.io>'
-
- macro compose '\3' "<edit-from><kill-line>Alejandro Soto \<alejandro@34project.org\><enter>"
- macro compose '\g' "<edit-from><kill-line>Alejandro Soto \<alejandrosotochacon@gmail.com\><enter>"
- macro compose '\x' "<edit-from><kill-line>Alejandro Soto \<soto@exdev.io\><enter>"
- '';
- };
- };
-
- home = mkMerge
- [
- ({
- file.".mailcap".text = ''
- text/html; ${pkgs.luakit}/bin/luakit '%s' &; test=test -n "$DISPLAY"; needsterminal;
- text/html; ${pkgs.lynx}/bin/lynx -dump %s; nametemplate=%s.html; copiousoutput;
- '';
- })
-
- # .dovecot.sieve tiene que ser un symlink tal que el readlink -f de su
- # dirname (no del symlink en sí) sea la misma cadena que el readlink -f
- # de ~/sieve. Dovecot verifica eso y tira "Invalid/unknown path to
- # storage" si este check frágil falla. Ni siquiera
- # mkOutOfStoreSymlink funciona. Ver código fuente de Dovecot:
- # pigeonhole/src/lib-sieve/storage/file/sieve-file-storage-active.c
- (
- let
- sieve = pkgs.runCommandNoCCLocal "sieve" { src = ./sieve; } ''
- cp -r $src $out
- chmod -R u+w $out
- find $out -name '*.sieve' -exec ${pkgs.dovecot_pigeonhole}/bin/sievec -c /dev/null {} \;
- '';
- in
- mkIf config.local.mail.sieve.enable {
- file."sieve".source = sieve;
-
- activation.sieve = hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''
- $DRY_RUN_CMD ln -Tsf ${sieve}/mail.sieve .dovecot.sieve
- $DRY_RUN_CMD ln -Tsf ${sieve}/mail.svbin .dovecot.svbin
- '';
- }
- )
- ];
- };
-}
diff --git a/home/mail/.gitignore b/home/pim/.gitignore
index 1d9a3a0..1d9a3a0 100644
--- a/home/mail/.gitignore
+++ b/home/pim/.gitignore
diff --git a/home/pim/default.nix b/home/pim/default.nix
new file mode 100644
index 0000000..47b4a41
--- /dev/null
+++ b/home/pim/default.nix
@@ -0,0 +1,6 @@
+{
+ imports = [
+ ./mail.nix
+ ./syncthing.nix
+ ];
+}
diff --git a/home/mail/sieve/mail.sieve b/home/pim/mail.nix
index 1bb3788..1bb3788 100644
--- a/home/mail/sieve/mail.sieve
+++ b/home/pim/mail.nix
diff --git a/home/pim/sieve/mail.sieve b/home/pim/sieve/mail.sieve
new file mode 100644
index 0000000..1bb3788
--- /dev/null
+++ b/home/pim/sieve/mail.sieve
@@ -0,0 +1 @@
+# This file has been lustrated.
diff --git a/home/syncthing/default.nix b/home/pim/syncthing.nix
index e234c42..e234c42 100644
--- a/home/syncthing/default.nix
+++ b/home/pim/syncthing.nix