summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Installer/Types.hs
diff options
context:
space:
mode:
authorJoey Hess2017-12-30 13:24:32 -0400
committerJoey Hess2017-12-30 13:24:32 -0400
commitb9f9692a7d847c8d71f42754b0a9775416ab4cf3 (patch)
treec0cf16bae65866c700f5796579af2c3a8508745e /src/Propellor/Property/Installer/Types.hs
parenta87a740930be75b50e7ea23d58aa2e657880da66 (diff)
installer
Added Propellor.Property.Installer modules, which can be used to create bootable installer disk images, which then run propellor to install a system. This code was extracted from the demo I gave at my talk at DebConf 2017, from the secret-project repository. That repository was AGPL licensed. I hereby relicense the code committed here under the same 2-clause BSD license as the rest of propellor. Changes from secret-project: Generalized UserInput to a type class, and added a lot more documentation and examples. This commit was sponsored by Brock Spratlen on Patreon.
Diffstat (limited to 'src/Propellor/Property/Installer/Types.hs')
-rw-r--r--src/Propellor/Property/Installer/Types.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Propellor/Property/Installer/Types.hs b/src/Propellor/Property/Installer/Types.hs
new file mode 100644
index 00000000..648cf3b3
--- /dev/null
+++ b/src/Propellor/Property/Installer/Types.hs
@@ -0,0 +1,16 @@
+module Propellor.Property.Installer.Types where
+
+-- | The disk device to install to.
+newtype TargetDiskDevice = TargetDiskDevice FilePath
+ deriving (Read, Show)
+
+data DiskEraseConfirmed = DiskEraseConfirmed
+ deriving (Read, Show)
+
+-- | Class of user input that an installer might prompt for.
+class UserInput i where
+ -- | Get the disk device the user selected to install to.
+ targetDiskDevice :: i -> Maybe TargetDiskDevice
+ -- | Check if the user has confirmed they want to erase the target
+ -- disk device.
+ diskEraseConfirmed :: i -> Maybe DiskEraseConfirmed