From a6d2d856a52e5b3e19025a29be8c73bb9a61c05d Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Fri, 5 Aug 2022 23:31:27 -0400 Subject: [PATCH] ENH turn rofi device config into template --- .chezmoi.yaml.tmpl | 1 + .../rofi/{devices.yml => devices.yml.tmpl} | 102 ++++++++---------- 2 files changed, 44 insertions(+), 59 deletions(-) rename dot_config/rofi/{devices.yml => devices.yml.tmpl} (55%) diff --git a/.chezmoi.yaml.tmpl b/.chezmoi.yaml.tmpl index 38776ae..5041b61 100644 --- a/.chezmoi.yaml.tmpl +++ b/.chezmoi.yaml.tmpl @@ -23,6 +23,7 @@ data: vpn: {{ and $desktop (promptBool "vpn" false) }} seafile: {{ and $desktop (promptBool "seafile" false) }} conky_alias: {{ if $desktop -}}{{ (promptString "conky" "none") }}{{ else }}none{{ end }} + rofi_alias: {{ if $desktop -}}{{ (promptString "rofi-alias" "none") }}{{ else }}none{{ end }} development: {{- /* emacs implies that most development options are true */}} diff --git a/dot_config/rofi/devices.yml b/dot_config/rofi/devices.yml.tmpl similarity index 55% rename from dot_config/rofi/devices.yml rename to dot_config/rofi/devices.yml.tmpl index ac127e6..c1e2343 100644 --- a/dot_config/rofi/devices.yml +++ b/dot_config/rofi/devices.yml.tmpl @@ -1,63 +1,28 @@ # directory for all relative, transitive mountpoints -mountdir: /tmp/media/ndwar +mountdir: /tmp/media/{{ .chezmoi.username }} verbose: false devices: - accounts: - type: veracrypt - mount: - mountpoint: accounts - volume: /mnt/data/Documents/.crypt/accounts - password: - bitwarden: - key: Veracrypt (accounts) +{{- if eq .features.rofi_alias "laptop" -}} +{{- $mntdata := "/mnt/data" -}} +{{- $crypt := $mntdata | printf "%s/Documents/.crypt" }} gnupg: type: veracrypt mount: - mountpoint: /home/ndwar/.config/gnupg - volume: /mnt/data/Documents/.crypt/gnupg + mountpoint: {{ .paths.config }}/gnupg + volume: {{ $crypt }}/gnupg password: bitwarden: key: Veracrypt (gpg) ssh: type: veracrypt mount: - mountpoint: /home/ndwar/.ssh + mountpoint: {{ .chezmoi.homeDir }}/.ssh label: ssh - volume: /mnt/data/Documents/.crypt/ssh-config + volume: {{ $crypt }}/ssh-config password: bitwarden: key: Veracrypt (ssh) - ansible_pki: - type: veracrypt - mount: - mountpoint: ansible-pki - volume: /mnt/data/Documents/.crypt/ansible - password: - bitwarden: - key: Veracrypt (Ansible PKI) - call_logs: - type: veracrypt - mount: - mountpoint: call-logs - volume: /mnt/data/Documents/.crypt/call_logs - password: - bitwarden: - key: Veracrypt (ACR) - music: - type: sshfs - mount: - mountpoint: /mnt/data/Music - remote: portnoy4prez:/mnt/data/home/Music - depends: - - ssh - videos: - type: sshfs - mount: - mountpoint: /mnt/data/Videos - remote: portnoy4prez:/mnt/data/home/Videos - depends: - - ssh ebm_snakemake: type: sshfs mount: @@ -66,23 +31,42 @@ devices: remote: nisaba:/aigenomics/EBM_dev/snakemake depends: - ssh - roylab: - type: cifs + accounts: + type: veracrypt mount: - mountpoint: Roylab - remote: //ad.gatech.edu/bme/labs/roy-lab + mountpoint: accounts + volume: {{ $crypt }}/accounts password: - libsecret: - attributes: - user: ndwarshuis3@gatech.edu - host: outlook.office365.com - mc3m: - type: cifs + bitwarden: + key: Veracrypt (accounts) + ansible_pki: + type: veracrypt mount: - mountpoint: MC3M - remote: //ad.gatech.edu/bme/labs/mc3m + mountpoint: ansible-pki + volume: {{ $crypt }}/ansible password: - libsecret: - attributes: - user: ndwarshuis3@gatech.edu - host: outlook.office365.com + bitwarden: + key: Veracrypt (Ansible PKI) + call_logs: + type: veracrypt + mount: + mountpoint: call-logs + volume: {{ $crypt }}/call_logs + password: + bitwarden: + key: Veracrypt (ACR) + music: + type: sshfs + mount: + mountpoint: {{ $mntdata }}/Music + remote: portnoy4prez:/mnt/data/home/Music + depends: + - ssh + videos: + type: sshfs + mount: + mountpoint: {{ $mntdata }}/Videos + remote: portnoy4prez:/mnt/data/home/Videos + depends: + - ssh +{{ end -}} \ No newline at end of file