From 87d1caba7b24849c1edcad6f4810d4a9f7a6deba Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 30 Sep 2023 01:11:23 -0400 Subject: [PATCH] ADD work laptop rofi config --- .files/rofi-dev-configs/work-laptop.dhall | 88 +++++++++++++++++++++++ dot_config/rofi/devices.dhall.tmpl | 2 + 2 files changed, 90 insertions(+) create mode 100644 .files/rofi-dev-configs/work-laptop.dhall diff --git a/.files/rofi-dev-configs/work-laptop.dhall b/.files/rofi-dev-configs/work-laptop.dhall new file mode 100644 index 0000000..0e13a44 --- /dev/null +++ b/.files/rofi-dev-configs/work-laptop.dhall @@ -0,0 +1,88 @@ +let C = ../rofi-extras/dhall/rofi-dev.dhall + +let cryptdir = "${env:HOME as Text}/.crypt" + +let sshKey = "ssh nanobarbie" + +let gpgKey = "gpg nanobarbie" + +let bwConfig = + \(k : Text) -> + C.PasswordConfig.PwdBW ({ bwKey = k, bwTries = 2 } : C.BitwardenConfig) + +let sshData = + \(r : Text) -> + C.DataConfig.SSHFSConfig + ( { sshfsRemote = r, sshfsPassword = None C.PasswordConfig } + : C.SSHFSData + ) + +let sshfsTree = + \(m : Text) -> + \(l : Text) -> + \(r : Text) -> + { tcParent = + { deviceMount = { mpPath = m, mpLabel = Some l } : C.MountConfig + , deviceData = sshData r + } + : C.DeviceConfig + , tcChildren = [ "ssh" ] + } + : C.TreeConfig + +let crypt = \(b : Text) -> "${cryptdir}/${b}" + +let vcName = \(n : Text) -> "Veracrypt (${n})" + +let vcryptTree = + \(m : Text) -> + \(l : Optional Text) -> + \(v : Text) -> + \(k : Text) -> + { tcParent = + { deviceMount = { mpPath = m, mpLabel = l } : C.MountConfig + , deviceData = + C.DataConfig.VeracryptConfig + ( { vcVolume = crypt v + , vcPassword = Some (bwConfig (vcName k)) + } + : C.VeracryptData + ) + } + : C.DeviceConfig + , tcChildren = [] : List Text + } + : C.TreeConfig + +let defaultDevs = + [ { tKey = "ssh" + , tVal = + vcryptTree + "${env:HOME as Text}/.ssh" + (Some "ssh") + "ssh-config" + sshKey + } + , { tKey = "gnupg" + , tVal = + vcryptTree + "${env:GNUPGHOME as Text}" + (None Text) + "gpg-config" + gpgKey + } + ] + +let otherDevs =[ { tKey = "ebm_snakemake" + , tVal = + sshfsTree + "ebm_snakemake" + "EBM" + "nisaba:/aigenomics/EBM_dev/snakemake" + } + ] + +in { scTmpPath = Some "/tmp/media/${env:LOGNAME as Text}" + , scVerbose = Some False + , scDevices = defaultDevs # otherDevs + } diff --git a/dot_config/rofi/devices.dhall.tmpl b/dot_config/rofi/devices.dhall.tmpl index 903bf51..bad0736 100644 --- a/dot_config/rofi/devices.dhall.tmpl +++ b/dot_config/rofi/devices.dhall.tmpl @@ -2,4 +2,6 @@ {{- include ".files/rofi-dev-configs/laptop.dhall" -}} {{- else if eq .features.conky_alias "workstation" -}} {{- include ".files/rofi-dev-configs/workstation.dhall" -}} +{{- else if eq .features.conky_alias "work-laptop" -}} +{{- include ".files/rofi-dev-configs/work-laptop.dhall" -}} {{- end -}}