summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog1
-rw-r--r--src/Propellor/Property/Borg.hs4
2 files changed, 5 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 225b71b0..cc0e0a15 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,7 @@ propellor (5.5.0) UNRELEASED; urgency=medium
This fixes a potential ordering problem; the property used to append
the line to /etc/sudoers, but that would override more specific lines
in the include directory.
+ * Borg: Added UsesEnvVar.
-- Joey Hess <id@joeyh.name> Thu, 09 Aug 2018 10:54:41 -0400
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