ENH config rofi config for laptop

This commit is contained in:
Nathan Dwarshuis 2024-08-09 16:18:26 -04:00
parent 3c1499b44c
commit 09ccdd2473
1 changed files with 72 additions and 64 deletions

View File

@ -1,91 +1,99 @@
let C = ../rofi-extras/dhall/rofi-dev.dhall
let cryptdir = "${env:HOME as Text}/.crypt"
let cryptdir = "${env:HOME as Text}/Documents/.crypt"
let sshKey = "ssh nanobarbie"
let gpgKey = "gpg nanobarbie"
let bwConfig =
\(k : Text) ->
C.PasswordConfig.PwdBW ({ bwKey = k, bwTries = 2 } : C.BitwardenConfig)
\(k : Text) -> C.PasswordConfig.PwdBW C.BitwardenConfig::{ bwKey = k }
let sshData =
\(r : Text) ->
C.DataConfig.SSHFSConfig
( { sshfsRemote = r, sshfsPassword = None C.PasswordConfig }
: C.SSHFSData
)
\(r : Text) -> C.DataConfig.SSHFSConfig C.SSHFSData::{ sshfsRemote = r }
let sshfsTree =
\(m : Text) ->
let sshfsEntry =
\(l : Text) ->
\(m : Text) ->
\(r : Text) ->
{ tcParent =
{ deviceMount = { mpPath = m, mpLabel = Some l } : C.MountConfig
, deviceData = sshData r
}
: C.DeviceConfig
, tcChildren = [ "ssh" ]
{ tKey = l
, tVal =
{ tcParent =
{ deviceMount = { mpPath = m, mpLabel = Some l }
, deviceData = sshData r
}
, tcChildren = [ "ssh" ]
}
}
: C.TreeConfig
: C.TreeMap
let crypt = \(b : Text) -> "${cryptdir}/${b}"
let vcName = \(n : Text) -> "Veracrypt (${n})"
let vcryptTree =
let vcryptEntry =
\(l : Text) ->
\(m : Text) ->
\(l : Optional Text) ->
\(v : Text) ->
\(k : Text) ->
{ tcParent =
{ deviceMount = { mpPath = m, mpLabel = l }
, deviceData =
C.DataConfig.VeracryptConfig
{ vcVolume = v, vcPassword = Some (bwConfig (vcName k)) }
{ tKey = l
, tVal = C.TreeConfig::{
, tcParent =
{ deviceMount = { mpPath = m, mpLabel = Some l }
, deviceData =
C.DataConfig.VeracryptConfig
{ vcVolume = v, vcPassword = Some (bwConfig (vcName k)) }
}
}
}
: C.TreeMap
let cifsEntry =
\(l : Text) ->
\(m : Text) ->
\(r : Text) ->
\(o : Optional C.CIFSOpts.Type) ->
{ tKey = l
, tVal = C.TreeConfig::{
, tcParent =
{ deviceMount = { mpPath = m, mpLabel = Some l }
, deviceData =
C.DataConfig.CIFSConfig
{ cifsRemote = r
, cifsSudo = True
, cifsPassword = Some
(C.PasswordConfig.PwdPr C.PromptConfig::{=})
, cifsOpts = o
}
}
}
, tcChildren = [] : List Text
}
let defaultDevs =
[ { tKey = "ssh"
, tVal =
vcryptTree
"${env:HOME as Text}/.ssh"
(Some "ssh")
(crypt "ssh-config")
sshKey
}
, { tKey = "gnupg"
, tVal =
vcryptTree
"${env:GNUPGHOME as Text}"
(None Text)
(crypt "gpg-config")
gpgKey
}
, { tKey = "pii"
, tVal =
vcryptTree
"pii"
(None Text)
"${env:HOME as Text}/Documents/.crypt"
"work vault"
}
let devs =
[ vcryptEntry
"ssh"
"${env:HOME as Text}/.ssh"
(crypt "ssh-config-nanobarbie")
sshKey
, vcryptEntry
"gnupg"
"${env:GNUPGHOME as Text}"
(crypt "gpg-config")
gpgKey
, vcryptEntry "pii" "pii" (crypt "pii") "work vault"
, sshfsEntry "nisaba_wrk" "nisaba_wrk" "nisaba:/wrk/njd2"
, sshfsEntry "nist_dvl" "nist_dvl" "nist-workstation:/mnt/data/Dvl"
, cifsEntry
"flowILS"
"flowILS"
"\\\\elwood.nist.gov\\63_MML\\63internal\\Flow ILS Share"
( Some
C.CIFSOpts::{
, cifsoptsUsername = Some "njd2"
, cifsoptsUID = Some 69444
, cifsoptsGID = Some 36679
}
)
]
let otherDevs =
[ { tKey = "nisaba-wrk"
, tVal = sshfsTree "nisaba_wrk" "nisaba_wrk" "nisaba:/wrk/njd2"
}
, { tKey = "nist-dvl"
, tVal =
sshfsTree "nist_dvl" "nist_dvl" "nist-workstation:/mnt/data/Dvl"
}
]
in { scTmpPath = Some "/tmp/media/${env:LOGNAME as Text}"
, scVerbose = Some False
, scDevices = defaultDevs # otherDevs
}
in C.StaticConfig::{ scDevices = devs }