From 002bc57279ce4c571dd293c8812014fe8edcfd79 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 3 Apr 2016 19:20:35 +0000 Subject: merge request --- ...init__96___should_sometimes_run___96__cabal_sandbox_init__96__.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/todo/merge_request:___96__propellor_--init__96___should_sometimes_run___96__cabal_sandbox_init__96__.mdwn (limited to 'doc') 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. -- cgit v1.2.3 From e3111c683e96f1beb11477866a3227ce4b06d25a Mon Sep 17 00:00:00 2001 From: frederik@ffbea6a549cb3f460d110386c0f634c1ddc6a68a Date: Tue, 5 Apr 2016 14:03:49 +0000 Subject: --- doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn (limited to 'doc') 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..4f8b7f86 --- /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"]’ -- cgit v1.2.3 From 88dbf97a3678325340a7c10608c9552e0516faaf Mon Sep 17 00:00:00 2001 From: frederik@ffbea6a549cb3f460d110386c0f634c1ddc6a68a Date: Tue, 5 Apr 2016 14:05:23 +0000 Subject: --- doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn b/doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn index 4f8b7f86..9a2cc33e 100644 --- a/doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn +++ b/doc/forum/newbie_trying_to_set_up_NFS_mount.mdwn @@ -12,7 +12,7 @@ I tried putting in config.hs, but that results in Couldn't match expected type ‘Mount.MountOpts’ - with actual type ‘[[Char]]’ + with actual type ‘\[[Char]]’ In the fourth argument of ‘Mount.mounted’, namely ‘["defaults"]’ In the second argument of ‘(&)’, namely ‘Mount.mounted -- cgit v1.2.3 From 7070899c187a3d2c6be538b8497428a23ae096f3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 Apr 2016 11:09:57 -0400 Subject: comment --- ...ent_1_8524e66ddfa2d21ae7b70f257984fc2c._comment | 30 ++++++++++++++++++++++ src/Propellor/Property/Mount.hs | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 doc/forum/newbie_trying_to_set_up_NFS_mount/comment_1_8524e66ddfa2d21ae7b70f257984fc2c._comment (limited to 'doc') 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/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 -- cgit v1.2.3