diff options
Diffstat (limited to 'tw/home')
-rw-r--r-- | tw/home/cern.scm | 55 | ||||
-rw-r--r-- | tw/home/files/aerc/accounts.work.conf | 20 | ||||
-rw-r--r-- | tw/home/files/aerc/aerc.conf | 2 | ||||
-rw-r--r-- | tw/home/files/gitconfig | 7 | ||||
-rw-r--r-- | tw/home/files/zshrc | 3 | ||||
-rw-r--r-- | tw/home/lap.scm | 43 |
6 files changed, 114 insertions, 16 deletions
diff --git a/tw/home/cern.scm b/tw/home/cern.scm index 837098d5..dc3042c1 100644 --- a/tw/home/cern.scm +++ b/tw/home/cern.scm @@ -8,23 +8,65 @@ ;; https://github.com/alezost/shepherd-config/blob/master/init.scm (define-module (tw home cern) + #:use-module ((gnu) + #:select (use-package-modules)) #:use-module (gnu home) + #:use-module (gnu home services) #:use-module (gnu home services desktop) #:use-module (gnu home services guix) + #:use-module (gnu home services mcron) + #:use-module (gnu home services pm) #:use-module (gnu home services shepherd) - #:use-module (gnu packages xdisorg) - #:use-module (gnu packages xorg) + #:use-module (gnu packages) #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (guix channels) #:use-module (guix gexp) - #:use-module (tw home)) + #:use-module ((nongnu packages messaging) + #:select (zoom)) + #:use-module (tw home) + #:use-module (tw packages alice) + #:use-module (tw packages ci) + #:use-module (tw packages catppuccin) + #:use-module (tw packages xorg) + #:use-module (tw gexp) + #:use-module (tw theme)) + +(use-package-modules calendar dav mail web-browsers xdisorg xorg) + +(define pim-packages + (list vdirsyncer khal khard aerc lynx)) ; lynx for HTML mail + +(define pim-services + (list + (simple-service 'pim-config home-xdg-configuration-files-service-type + `(("khal/config" ,(local-file "files/khal.conf")) + ("khard/khard.conf" ,(local-file "files/khard.conf")) + ("aerc/accounts.conf" ,(local-file "files/aerc/accounts.work.conf")) + ("aerc/aerc.conf" ,(local-file "files/aerc/aerc.conf")) + ("aerc/binds.conf" ,(local-file "files/aerc/binds.conf")) + ("aerc/filters" ,(local-file "files/aerc/filters" #:recursive? #t)) + ("aerc/stylesets" ,(local-file "files/aerc/stylesets" #:recursive? #t)) + ("vdirsyncer/config" ,(local-file "files/vdirsyncer.conf")))) + + ;; These cron jobs are annoying because they pop up a password prompt every time they run. + ;; (simple-service 'pim-cronjobs home-mcron-service-type + ;; (list #~(job "15 */4 * * *" ; every four hours at HH:15 + ;; (string-append #$(file-append vdirsyncer "/bin/vdirsyncer") " metasync")) + ;; #~(job "0,30 * * * *" ; every half hour + ;; (string-append #$(file-append vdirsyncer "/bin/vdirsyncer") " sync")))) + + (simple-service 'mail-files home-files-service-type + `(;; The file from git main is newer than the one bundled with the + ;; packaged neomutt version and contains a few fixes. + (".local/bin/mutt_oauth2.py" + ,(local-file "files/neomutt/contrib/oauth2/mutt_oauth2.py" #:recursive? #t)))))) (define-public %cern-home (home-environment (packages ;; These packages will show up in the home profile, under ~/.guix-home/profile. - (append %interactive-packages %pim-packages %common-packages)) + (append %common-packages %interactive-packages pim-packages)) ;; To search for available home services, run 'guix home search KEYWORD'. (services @@ -57,10 +99,11 @@ (nighttime-brightness 0.7) (extra-content "fade=0"))) ; with fade=1, restarting redshift causes flickering for a few secs - (simple-service 'cern-desktop-gui-services home-shepherd-service-type + (simple-service 'xorg-setup-services home-shepherd-service-type (list (polybar-service "DP-2") (polybar-service "DP-1-8") + (shepherd-service (documentation "Set up X displays on login.") (provision '(xorg-setup)) @@ -83,6 +126,6 @@ (openssh-service #f) - (append %interactive-services %pim-services %common-services))))) + (append %common-services %interactive-services pim-services))))) %cern-home diff --git a/tw/home/files/aerc/accounts.work.conf b/tw/home/files/aerc/accounts.work.conf new file mode 100644 index 00000000..469c912e --- /dev/null +++ b/tw/home/files/aerc/accounts.work.conf @@ -0,0 +1,20 @@ +[CERN] +# https://man.sr.ht/~rjarry/aerc/providers/microsoft.md#office365-with-xoauth2 +source = imaps+xoauth2://timo.wilken%40cern.ch@outlook.office365.com?client_id=9e5f94bc-e8a4-4e73-b8be-63364c29d753&token_endpoint=https://login.microsoftonline.com/common/oauth2/v2.0/token&scope=https://outlook.office.com/SMTP.Send https://outlook.office.com/IMAP.AccessAsUser.All offline_access +outgoing = smtp+xoauth2://timo.wilken%40cern.ch@smtp.office365.com:587?client_id=9e5f94bc-e8a4-4e73-b8be-63364c29d753&token_endpoint=https://login.microsoftonline.com/common/oauth2/v2.0/token&scope=https://outlook.office.com/SMTP.Send https://outlook.office.com/IMAP.AccessAsUser.All offline_access +smtp-starttls = yes +# To authorize for the first time (to get refresh token): +# mutt_oauth2.py ~/.local/share/aerc/twilken.tokens --authorize --authflow authcode --provider microsoft \ +# --email timo.wilken@cern.ch --client-id 9e5f94bc-e8a4-4e73-b8be-63364c29d753 --client-secret '' \ +# --encryption-pipe 'gpg --encrypt --recipient C2249BBE5E8761C943A0CFA1B7B3914BF63ACD7C' +# Confirm empty client secret. When done, copy-paste ?code= value from final URL to the command-line. +# Then, to store the refresh token: +# gpg --decrypt ~/.local/share/aerc/twilken.tokens | jq -r .refresh_token | pass insert -e -f cern/exol/refresh-token +source-cred-cmd = pass cern/exol/refresh-token +outgoing-cred-cmd = pass cern/exol/refresh-token +default = INBOX +from = Timo Wilken <timo.wilken@cern.ch> +aliases = twilken@cern.ch +copy-to = Sent Items +postpone = Drafts +cache-headers = true diff --git a/tw/home/files/aerc/aerc.conf b/tw/home/files/aerc/aerc.conf index aae2806a..01c2527d 100644 --- a/tw/home/files/aerc/aerc.conf +++ b/tw/home/files/aerc/aerc.conf @@ -126,7 +126,7 @@ text/html=lynx -display_charset=UTF-8 -force_html -dump -stdin #text/*=bat -fP --file-name="$AERC_FILENAME" #application/x-sh=bat -fP -l sh #image/*=catimg -w $(tput cols) - -image/*=kitty +kitten icat /dev/stdin +image/*=imv - #subject,~Git(hub|lab)=lolcat -f #from,thatguywhodoesnothardwraphismessages=fmt -w 72 | colorize diff --git a/tw/home/files/gitconfig b/tw/home/files/gitconfig index 51e60054..6bed5cc8 100644 --- a/tw/home/files/gitconfig +++ b/tw/home/files/gitconfig @@ -1,13 +1,10 @@ # This is Git's per-user configuration file. [user] name = Timo Wilken - email = git@twilken.net - signingkey = 53EC3C06856883DD92355BC22FC78504681F69B0 + email = timo.wilken@cern.ch + signingkey = C2249BBE5E8761C943A0CFA1B7B3914BF63ACD7C [commit] gpgsign = true -# For work repos, include the gitconfig that sets up my work identity. -[includeIf "gitdir:~/src/alice/"] - path = ~/src/alice/.gitconfig [url "https://"] insteadOf = git:// [url "ssh://git@gitlab.cern.ch:7999/"] diff --git a/tw/home/files/zshrc b/tw/home/files/zshrc index 882cf60c..2382fa27 100644 --- a/tw/home/files/zshrc +++ b/tw/home/files/zshrc @@ -105,6 +105,9 @@ alias nomad-diskfree='NOMAD_TOKEN=$(pass cern/ci/nomad-bootstrap-token | head -1 alias levant='NOMAD_TOKEN=$(pass cern/ci/nomad-bootstrap-token | head -1) \levant' alias consul='CONSUL_HTTP_TOKEN=$(pass cern/ci/consul-bootstrap-token | head -1) \consul' alias vault='VAULT_TOKEN=$(pass cern/ci/vault-root-token | head -1) \vault' +nomad-shell () { + nomad alloc exec "$1" sh -c 'export TERM=xterm-256color HOME=$NOMAD_TASK_DIR PS1="\\u@\\h \\w \\\$ "; cd; exec bash -i' +} # Git aliases alias ga='git add' diff --git a/tw/home/lap.scm b/tw/home/lap.scm index 13083c83..f006d8e1 100644 --- a/tw/home/lap.scm +++ b/tw/home/lap.scm @@ -14,13 +14,17 @@ #:use-module (gnu home services guix) #:use-module (gnu home services pm) #:use-module (gnu home services shepherd) - #:use-module (gnu packages) #:use-module (gnu packages android) #:use-module (gnu packages bittorrent) + #:use-module (gnu packages calendar) + #:use-module (gnu packages dav) #:use-module (gnu packages gnome) + #:use-module (gnu packages mail) #:use-module (gnu packages messaging) #:use-module (gnu packages music) #:use-module (gnu packages networking) + #:use-module (gnu packages syndication) + #:use-module (gnu packages web-browsers) #:use-module (gnu packages xorg) #:use-module (gnu packages xdisorg) #:use-module (gnu services) @@ -31,7 +35,38 @@ #:select (signal-desktop)) #:use-module ((nongnu packages steam-client) #:select (steam)) - #:use-module (tw home)) + #:use-module (tw home) + #:use-module (tw theme)) + +(define pim-packages + (list newsboat vdirsyncer khal khard aerc lynx)) ; lynx for HTML mail + +(define pim-services + (list + (simple-service 'pim-config home-xdg-configuration-files-service-type + `(("khal/config" ,(local-file "home/files/khal.conf")) + ("khard/khard.conf" ,(local-file "home/files/khard.conf")) + ("aerc/accounts.conf" ,(local-file "files/aerc/accounts.conf")) + ("aerc/aerc.conf" ,(local-file "files/aerc/aerc.conf")) + ("aerc/binds.conf" ,(local-file "files/aerc/binds.conf")) + ("aerc/filters" ,(local-file "files/aerc/filters" #:recursive? #t)) + ("aerc/stylesets" ,(local-file "files/aerc/stylesets" #:recursive? #t)) + ("newsboat/config" ,(local-file "home/files/newsboat.conf")) + ("newsboat/config.catppuccin" ,catppuccin-newsboat) + ("vdirsyncer/config" ,(local-file "home/files/vdirsyncer.conf")))) + + ;; These cron jobs are annoying because they pop up a password prompt every time they run. + ;; (simple-service 'pim-cronjobs home-mcron-service-type + ;; (list #~(job "15 */4 * * *" ; every four hours at HH:15 + ;; (string-append #$(file-append vdirsyncer "/bin/vdirsyncer") " metasync")) + ;; #~(job "0,30 * * * *" ; every half hour + ;; (string-append #$(file-append vdirsyncer "/bin/vdirsyncer") " sync")))) + + (simple-service 'mail-files home-files-service-type + `(;; The file from git main is newer than the one bundled with the + ;; packaged neomutt version and contains a few fixes. + (".local/bin/mutt_oauth2.py" + ,(local-file "home/files/neomutt/contrib/oauth2/mutt_oauth2.py" #:recursive? #t)))))) (define-public %lap-home (home-environment @@ -50,7 +85,7 @@ ;; home environment faster. ;; 0ad flightgear freeciv simutrans/pak128 warzone2100 widelands pioneer - (append %interactive-packages %pim-packages %common-packages))) + (append %interactive-packages pim-packages %common-packages))) ;; To search for available home services, run 'guix home search KEYWORD'. (services @@ -133,6 +168,6 @@ (openssh-service #t) - (append %pim-services %interactive-services %common-services))))) + (append pim-services %interactive-services %common-services))))) %lap-home |