summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/Chroot.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-21 20:09:33 -0400
committerJoey Hess2014-11-21 20:09:33 -0400
commit6be49197f6ddf391a21b61e0996ef4bb75cd8b1b (patch)
tree29d442e7b1093275ee1b44fab4138232bdad5dd4 /src/Propellor/Types/Chroot.hs
parent6c92f1034f980718cef54cab58a1bcfdbc485f5d (diff)
allow configuring systemd-nspawn parameters
Diffstat (limited to 'src/Propellor/Types/Chroot.hs')
-rw-r--r--src/Propellor/Types/Chroot.hs22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/Propellor/Types/Chroot.hs b/src/Propellor/Types/Chroot.hs
index d4dd6eae..b10e9817 100644
--- a/src/Propellor/Types/Chroot.hs
+++ b/src/Propellor/Types/Chroot.hs
@@ -3,13 +3,27 @@ module Propellor.Types.Chroot where
import Data.Monoid
import qualified Data.Map as M
-data ChrootInfo h = ChrootInfo
- { _chroots :: M.Map FilePath h
+data ChrootInfo host = ChrootInfo
+ { _chroots :: M.Map FilePath host
+ , _chrootCfg :: ChrootCfg
}
deriving (Show)
-instance Monoid (ChrootInfo h) where
- mempty = ChrootInfo mempty
+instance Monoid (ChrootInfo host) where
+ mempty = ChrootInfo mempty mempty
mappend old new = ChrootInfo
{ _chroots = M.union (_chroots old) (_chroots new)
+ , _chrootCfg = _chrootCfg old <> _chrootCfg new
}
+
+data ChrootCfg
+ = ChrootCfg
+ | SystemdNspawnCfg [String]
+ deriving (Show)
+
+instance Monoid ChrootCfg where
+ mempty = ChrootCfg
+ mappend _ ChrootCfg = ChrootCfg
+ mappend ChrootCfg r = r
+ mappend (SystemdNspawnCfg l1) (SystemdNspawnCfg l2) =
+ SystemdNspawnCfg (l1 <> l2)