summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/Chroot.hs
diff options
context:
space:
mode:
authorJoey Hess2014-12-07 18:49:43 -0400
committerJoey Hess2014-12-07 18:49:43 -0400
commit21d87341ca75dcc7f33b87c8725738511f224311 (patch)
treed8aaf17b719888c2dbdf838073151b493320876c /src/Propellor/Types/Chroot.hs
parent19a1d6b7ed29aecf1ff3313eac9f07bf762d1dc6 (diff)
parent42a0c832483296fb111279fc3512a3dfd44f2089 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Types/Chroot.hs')
-rw-r--r--src/Propellor/Types/Chroot.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Propellor/Types/Chroot.hs b/src/Propellor/Types/Chroot.hs
index b7ed7807..d37d34c7 100644
--- a/src/Propellor/Types/Chroot.hs
+++ b/src/Propellor/Types/Chroot.hs
@@ -2,6 +2,7 @@ module Propellor.Types.Chroot where
import Data.Monoid
import qualified Data.Map as M
+import Propellor.Types.Empty
data ChrootInfo host = ChrootInfo
{ _chroots :: M.Map FilePath host
@@ -16,10 +17,16 @@ instance Monoid (ChrootInfo host) where
, _chrootCfg = _chrootCfg old <> _chrootCfg new
}
+instance Empty (ChrootInfo host) where
+ isEmpty i = and
+ [ isEmpty (_chroots i)
+ , isEmpty (_chrootCfg i)
+ ]
+
data ChrootCfg
= NoChrootCfg
| SystemdNspawnCfg [(String, Bool)]
- deriving (Show)
+ deriving (Show, Eq)
instance Monoid ChrootCfg where
mempty = NoChrootCfg
@@ -27,3 +34,6 @@ instance Monoid ChrootCfg where
mappend NoChrootCfg v = v
mappend (SystemdNspawnCfg l1) (SystemdNspawnCfg l2) =
SystemdNspawnCfg (l1 <> l2)
+
+instance Empty ChrootCfg where
+ isEmpty c= c == NoChrootCfg