diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-09-03 08:53:40 -0700 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-09-03 08:54:06 -0700 |
| commit | 43a67e310740e58707d0a7908237641ef46f5ae6 (patch) | |
| tree | 89df6bbb593bc85f8a443316c16dd4cd893f97d1 /src/Propellor/Info.hs | |
| parent | f158d1cf81c2fe4ece5320dd725496043e5b953d (diff) | |
| parent | 776b4dc3b24f8d30fa0fe56254c16e613d8e0bbe (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Info.hs')
| -rw-r--r-- | src/Propellor/Info.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Propellor/Info.hs b/src/Propellor/Info.hs index f1f23b96..0eea0816 100644 --- a/src/Propellor/Info.hs +++ b/src/Propellor/Info.hs @@ -18,10 +18,15 @@ pureInfoProperty desc i = infoProperty ("has " ++ desc) (return NoChange) i memp askInfo :: (Info -> Val a) -> Propellor (Maybe a) askInfo f = asks (fromVal . f . hostInfo) +-- | Specifies the operating system of a host. +-- +-- This only provides info for other Properties, so they can act +-- conditional on the os. os :: System -> Property HasInfo os system = pureInfoProperty ("Operating " ++ show system) $ mempty { _os = Val system } +-- Gets the operating system of a host, if it has been specified. getOS :: Propellor (Maybe System) getOS = askInfo _os |
