diff options
4 files changed, 53 insertions, 1 deletions
diff --git a/doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn b/doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn new file mode 100644 index 00000000..9a2cc33e --- /dev/null +++ b/doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn @@ -0,0 +1,19 @@ +I am checking out propellor to determine if it can make it easier to maintain a few personal machines. With no prior knowledge of Haskell, that may be a futile attempt. + +I am trying to understand [the Propellor.Property.Mount documentation](http://hackage.haskell.org/package/propellor-2.17.2/docs/Propellor-Property-Mount.html) and particularly how I would need to write the equivalent of + + mount -t nfs 192.168.1.100:/mnt/usb1 /mnt/nfs + +I tried putting + + & Mount.mounted + "nfs" "192.168.1.100:/mnt/usb1" "/mnt/nfs" ["defaults"] + +in config.hs, but that results in + + Couldn't match expected type ‘Mount.MountOpts’ + with actual type ‘\[[Char]]’ + In the fourth argument of ‘Mount.mounted’, namely ‘["defaults"]’ + In the second argument of ‘(&)’, namely + ‘Mount.mounted + "nfs" "192.168.1.100:/mnt/usb1" "/mnt/nfs" ["defaults"]’ diff --git a/doc/forum/newbie_trying_to_set_up_NFS_mount/comment_1_8524e66ddfa2d21ae7b70f257984fc2c._comment b/doc/forum/newbie_trying_to_set_up_NFS_mount/comment_1_8524e66ddfa2d21ae7b70f257984fc2c._comment new file mode 100644 index 00000000..0a4367d9 --- /dev/null +++ b/doc/forum/newbie_trying_to_set_up_NFS_mount/comment_1_8524e66ddfa2d21ae7b70f257984fc2c._comment @@ -0,0 +1,30 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-04-05T14:53:53Z" + content=""" +The easy way to translate your command to a property is: + + cmdProperty "mount" ["-t", "nfs", "192.168.1.100:/mnt/usb1", "/mnt/nfs"] + `assume` MadeChange + +This has the benefit of working with any command you might want, +and the drawback of not preventing eg, re-mounting an already +mounted device. + +`mounted` takes a `MountOpts` which is a specialized data type. +You can construct one with eg, `(MountOpts ["defaults"])`. + +But, since `MountOpts` is a `Monoid`, and "defaults" is the default of an +empty `MountOpts`, you can more simply use `mempty` to get the default one: + + Mount.mounted "nfs" "192.168.1.100:/mnt/usb1" "/mnt/nfs" mempty + +Propellor.Property.Mount was mostly written for use by some other +properties, and so doesn't really target the end user as much. And, I +notice, its `mounted` property doesn't check if the device is already +mounted and so will try to re-mount unnecessarily. + +I'm not sure if manually driving the mount command makes the most sense; +wouldn't it be better to have a property that updates /etc/fstab? +"""]] diff --git a/doc/todo/merge_request:___96__propellor_--init__96___should_sometimes_run___96__cabal_sandbox_init__96__.mdwn b/doc/todo/merge_request:___96__propellor_--init__96___should_sometimes_run___96__cabal_sandbox_init__96__.mdwn new file mode 100644 index 00000000..483af4a6 --- /dev/null +++ b/doc/todo/merge_request:___96__propellor_--init__96___should_sometimes_run___96__cabal_sandbox_init__96__.mdwn @@ -0,0 +1,3 @@ +Please consider merging branch `fix-init-build` of repository `https://git.spwhitton.name/propellor`. + +`propellor --init` can fail if the build system is cabal and the user has `require-sandbox: True` in `~/.cabal/config`. This patch fixes that. diff --git a/src/Propellor/Property/Mount.hs b/src/Propellor/Property/Mount.hs index 5921755c..943986c6 100644 --- a/src/Propellor/Property/Mount.hs +++ b/src/Propellor/Property/Mount.hs @@ -19,7 +19,7 @@ type Source = String -- | A mount point for a filesystem. type MountPoint = FilePath --- | Filesystem mount options. Eg, "errors=remount-ro" +-- | Filesystem mount options. Eg, MountOpts ["errors=remount-ro"] newtype MountOpts = MountOpts [String] deriving Monoid |
