summaryrefslogtreecommitdiff
path: root/src/Propellor/Property
diff options
context:
space:
mode:
authorJoey Hess2018-10-09 09:38:52 -0400
committerJoey Hess2018-10-09 09:38:52 -0400
commit900fec76cdbd24a3c3f4304198dd4afd9a87c8d3 (patch)
tree7a1a57503ee525ceb598e3a896b9ed12ef42a127 /src/Propellor/Property
parentbb25259b1a990a6041844e6dfbb09ca4e431c804 (diff)
Borg: Added UsesEnvVar.
For eg, BORG_REMOTE_PATH needed to use borg on rsync.net This commit was sponsored by Jochen Bartl on Patreon.
Diffstat (limited to 'src/Propellor/Property')
-rw-r--r--src/Propellor/Property/Borg.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Propellor/Property/Borg.hs b/src/Propellor/Property/Borg.hs
index dab07985..9d49fdf4 100644
--- a/src/Propellor/Property/Borg.hs
+++ b/src/Propellor/Property/Borg.hs
@@ -36,6 +36,9 @@ data BorgRepoOpt
-- | Use to specify a ssh private key to use when accessing a
-- BorgRepo.
= UseSshKey FilePath
+ -- | Use to specify an environment variable to set when running
+ -- borg on a BorgRepo.
+ | UsesEnvVar (String, String)
repoLoc :: BorgRepo -> String
repoLoc (BorgRepo s) = s
@@ -53,6 +56,7 @@ runBorgEnv (BorgRepo _) = []
runBorgEnv (BorgRepoUsing os _) = map go os
where
go (UseSshKey k) = ("BORG_RSH", "ssh -i " ++ k)
+ go (UsesEnvVar (k, v)) = (k, v)
installed :: Property DebianLike
installed = withOS desc $ \w o -> case o of