summaryrefslogtreecommitdiff
path: root/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'accounts')
-rw-r--r--accounts/gkleen@sif/default.nix2
-rw-r--r--accounts/gkleen@sif/utils/sieve-edit.nix24
-rw-r--r--accounts/gkleen@sif/zshrc16
3 files changed, 25 insertions, 17 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 3b3c7fc5..6574af9d 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -404,7 +404,7 @@ in {
404 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts 404 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts
405 swtpm (hunspellWithDicts (with hunspellDicts; [en_GB-large de_DE])) 405 swtpm (hunspellWithDicts (with hunspellDicts; [en_GB-large de_DE]))
406 # synadm 406 # synadm
407 ]; 407 ] ++ mapAttrsToList (_name: pkg: pkgs.callPackage pkg {}) (customUtils.nixImport { dir = ./utils; });
408 408
409 file = { 409 file = {
410 ".backup-munin".source = ./backup-patterns; 410 ".backup-munin".source = ./backup-patterns;
diff --git a/accounts/gkleen@sif/utils/sieve-edit.nix b/accounts/gkleen@sif/utils/sieve-edit.nix
new file mode 100644
index 00000000..f985a3f6
--- /dev/null
+++ b/accounts/gkleen@sif/utils/sieve-edit.nix
@@ -0,0 +1,24 @@
1pkgs@{ lib, resholve, zsh, sieve-connect, sops, ... }:
2
3resholve.writeScriptBin "sieve-edit" {
4 inputs = with pkgs; [sieve-connect sops];
5 interpreter = lib.getExe zsh;
6 execer = with pkgs; [
7 "cannot:${lib.getExe sieve-connect}"
8 "cannot:${lib.getExe sops}"
9 ];
10} ''
11 host=$1; shift
12 case "$host" in
13 surtr)
14 sieve-connect -s surtr.yggdrasil.li -m EXTERNAL --clientkey <(sops decrypt $HOME/projects/machines/hosts/surtr/email/ca/gkleen@sif.key) --clientcert $HOME/projects/machines/hosts/surtr/email/ca/gkleen@sif.crt --edit --remotesieve sieve
15 ;;
16 ymir)
17 sieve-connect -s ymir.yggdrasil.li -u gkleen --edit --remotesieve sieve
18 ;;
19 *)
20 echo "Unknown host: ‘$host’" >&2
21 return 2
22 ;;
23 esac
24''
diff --git a/accounts/gkleen@sif/zshrc b/accounts/gkleen@sif/zshrc
index f28ef590..c628e2e9 100644
--- a/accounts/gkleen@sif/zshrc
+++ b/accounts/gkleen@sif/zshrc
@@ -300,22 +300,6 @@ dichotomic_search() {
300 echo $min 300 echo $min
301} 301}
302 302
303sieve-edit() {
304 host=$1; shift
305 case "$host" in
306 surtr)
307 sieve-connect -s surtr.yggdrasil.li -m EXTERNAL --clientkey <(nix run nixos'#'sops -- decrypt ~flk/hosts/surtr/email/ca/gkleen@sif.key) --clientcert ~flk/hosts/surtr/email/ca/gkleen@sif.crt --edit --remotesieve sieve
308 ;;
309 ymir)
310 sieve-connect -s ymir.yggdrasil.li -u gkleen --edit --remotesieve sieve
311 ;;
312 *)
313 echo "Unknown host: ‘$host’" >&2
314 return 2
315 ;;
316 esac
317}
318
319while read -r -d $'\0' d _ s; do 303while read -r -d $'\0' d _ s; do
320 hash -d ${s}=${d} 304 hash -d ${s}=${d}
321done < <(find ~/projects ~/uni -regextype posix-extended -maxdepth 2 -type d -regex '\S+/[0-9]{2}[ws]/\S+' -print0 2>/dev/null | \ 305done < <(find ~/projects ~/uni -regextype posix-extended -maxdepth 2 -type d -regex '\S+/[0-9]{2}[ws]/\S+' -print0 2>/dev/null | \