ENH upate rofi dev dhall file

This commit is contained in:
Nathan Dwarshuis 2023-02-14 00:44:51 -05:00
parent 0007284a67
commit 1f866f554c
1 changed files with 74 additions and 39 deletions

View File

@ -1,3 +1,5 @@
let C = ../rofi-extras/dhall/rofi-dev.dhall
let cryptdir =
{{ if eq .features.rofi_alias "laptop" -}}
"/mnt/data/Documents/.crypt"
@ -23,25 +25,27 @@ let gpgKey =
let bwConfig =
\(k : Text) ->
PasswordConfig.PwdBW ({ bwKey = k, bwTries = +2 } : BitwardenConfig)
C.PasswordConfig.PwdBW ({ bwKey = k, bwTries = 2 } : C.BitwardenConfig)
let sshData =
\(r : Text) ->
DataConfig.SSHFSConfig
({ sshfsRemote = r, sshfsPassword = None PasswordConfig } : SSHFSData)
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 } : MountConfig
{ deviceMount = { mpPath = m, mpLabel = Some l } : C.MountConfig
, deviceData = sshData r
}
: DeviceConfig
: C.DeviceConfig
, tcChildren = [ "ssh" ]
}
: TreeConfig
: C.TreeConfig
let crypt = \(b : Text) -> "${cryptdir}/${b}"
@ -53,55 +57,86 @@ let vcryptTree =
\(v : Text) ->
\(k : Text) ->
{ tcParent =
{ deviceMount = { mpPath = m, mpLabel = l } : MountConfig
{ deviceMount = { mpPath = m, mpLabel = l } : C.MountConfig
, deviceData =
DataConfig.VeracryptConfig
C.DataConfig.VeracryptConfig
( { vcVolume = crypt v
, vcPassword = Some (bwConfig (vcName k))
}
: VeracryptData
: C.VeracryptData
)
}
: DeviceConfig
: C.DeviceConfig
, tcChildren = [] : List Text
}
: TreeConfig
: C.TreeConfig
let defaultDevs =
{ ssh =
vcryptTree "${env:HOME as Text}/.ssh" (Some "ssh") "ssh-config" sshKey
, gnupg =
vcryptTree "${env:GNUPGHOME as Text}" (None Text) "gpg-config" gpgKey
[ { 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 =
{{- if eq .features.rofi_alias "laptop" -}}
{ accounts = vcryptTree "accounts" (None Text) "accounts" "accounts"
, ansible-pki =
vcryptTree "ansible-pki" (None Text) "ansible" "Ansible PKI"
, call_logs = vcryptTree "call-logs" (None Text) "call_logs" "ACR"
, ebm_snakemake =
sshfsTree "ebm_snakemake" "EBM" "nisaba:/aigenomics/EBM_dev/snakemake"
, music =
[ { tKey = "accounts"
, tVal = vcryptTree "accounts" (None Text) "accounts" "accounts"
}
, { tKey = "ansible-pki"
, tVal = vcryptTree "ansible-pki" (None Text) "ansible" "Ansible PKI"
}
, { tKey = "call_logs"
, tVal = vcryptTree "call-logs" (None Text) "call_logs" "ACR"
}
, { tKey = "ebm_snakemake"
, tVal =
sshfsTree
"ebm_snakemake"
"EBM"
"nisaba:/aigenomics/EBM_dev/snakemake"
}
, { tKey = "music"
, tVal =
sshfsTree
"/mnt/data/Music"
"Music"
"portnoy4prez:/mnt/data/home/Music"
, videos =
}
, { tKey = "videos"
, tVal =
sshfsTree
"/mnt/data/Videos"
"Videos"
"portnoy4prez:/mnt/data/home/Videos"
}
]
{{- else if eq .features.rofi_alias "workstation" -}}
{ ebm_snakemake =
sshfsTree "ebm_snakemake" "EBM" "nisaba:/aigenomics/EBM_dev/snakemake"
[ { tKey = "ebm_snakemake"
, tVal =
sshfsTree
"ebm_snakemake"
"EBM"
"nisaba:/aigenomics/EBM_dev/snakemake"
}
]
{{- else -}}
{=}
[] : C.TreeMap
{{- end }}
in { scTmpPath = Some "/tmp/media/${env:LOGNAME as Text}"
, scVerbose = Some False
, scDevices = toMap (defaultDevs /\ otherDevs)
, scDevices = defaultDevs # otherDevs
}