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 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 sshKey = "ssh nanobarbie"
let gpgKey = "gpg nanobarbie" let gpgKey = "gpg nanobarbie"
let bwConfig = let bwConfig =
\(k : Text) -> \(k : Text) -> C.PasswordConfig.PwdBW C.BitwardenConfig::{ bwKey = k }
C.PasswordConfig.PwdBW ({ bwKey = k, bwTries = 2 } : C.BitwardenConfig)
let sshData = let sshData =
\(r : Text) -> \(r : Text) -> C.DataConfig.SSHFSConfig C.SSHFSData::{ sshfsRemote = r }
C.DataConfig.SSHFSConfig
( { sshfsRemote = r, sshfsPassword = None C.PasswordConfig }
: C.SSHFSData
)
let sshfsTree = let sshfsEntry =
\(m : Text) ->
\(l : Text) -> \(l : Text) ->
\(m : Text) ->
\(r : Text) -> \(r : Text) ->
{ tcParent = { tKey = l
{ deviceMount = { mpPath = m, mpLabel = Some l } : C.MountConfig , tVal =
, deviceData = sshData r { tcParent =
} { deviceMount = { mpPath = m, mpLabel = Some l }
: C.DeviceConfig , deviceData = sshData r
, tcChildren = [ "ssh" ] }
, tcChildren = [ "ssh" ]
}
} }
: C.TreeConfig : C.TreeMap
let crypt = \(b : Text) -> "${cryptdir}/${b}" let crypt = \(b : Text) -> "${cryptdir}/${b}"
let vcName = \(n : Text) -> "Veracrypt (${n})" let vcName = \(n : Text) -> "Veracrypt (${n})"
let vcryptTree = let vcryptEntry =
\(l : Text) ->
\(m : Text) -> \(m : Text) ->
\(l : Optional Text) ->
\(v : Text) -> \(v : Text) ->
\(k : Text) -> \(k : Text) ->
{ tcParent = { tKey = l
{ deviceMount = { mpPath = m, mpLabel = l } , tVal = C.TreeConfig::{
, deviceData = , tcParent =
C.DataConfig.VeracryptConfig { deviceMount = { mpPath = m, mpLabel = Some l }
{ vcVolume = v, vcPassword = Some (bwConfig (vcName k)) } , 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 = let devs =
[ { tKey = "ssh" [ vcryptEntry
, tVal = "ssh"
vcryptTree "${env:HOME as Text}/.ssh"
"${env:HOME as Text}/.ssh" (crypt "ssh-config-nanobarbie")
(Some "ssh") sshKey
(crypt "ssh-config") , vcryptEntry
sshKey "gnupg"
} "${env:GNUPGHOME as Text}"
, { tKey = "gnupg" (crypt "gpg-config")
, tVal = gpgKey
vcryptTree , vcryptEntry "pii" "pii" (crypt "pii") "work vault"
"${env:GNUPGHOME as Text}" , sshfsEntry "nisaba_wrk" "nisaba_wrk" "nisaba:/wrk/njd2"
(None Text) , sshfsEntry "nist_dvl" "nist_dvl" "nist-workstation:/mnt/data/Dvl"
(crypt "gpg-config") , cifsEntry
gpgKey "flowILS"
} "flowILS"
, { tKey = "pii" "\\\\elwood.nist.gov\\63_MML\\63internal\\Flow ILS Share"
, tVal = ( Some
vcryptTree C.CIFSOpts::{
"pii" , cifsoptsUsername = Some "njd2"
(None Text) , cifsoptsUID = Some 69444
"${env:HOME as Text}/Documents/.crypt" , cifsoptsGID = Some 36679
"work vault" }
} )
] ]
let otherDevs = in C.StaticConfig::{ scDevices = devs }
[ { 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
}