summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2018-09-14 17:13:22 -0400
committerJoey Hess2018-09-14 17:13:22 -0400
commit31eb6a3830effe76a20b8407e7971af7d6b058aa (patch)
tree1ccc977ab2743b1c0e767b9106a8c3e82d210192 /src
parent3a3dca4a0cea23aa71c042f10eff6b34145f24b1 (diff)
parent772a4c379f4dc3bd0640fa1afdfedd06a81f5f00 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/SiteSpecific/JoeySites.hs26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs
index fa7cb064..5e14d50f 100644
--- a/src/Propellor/Property/SiteSpecific/JoeySites.hs
+++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs
@@ -1061,6 +1061,7 @@ homeRouter = propertyList "home router" $ props
`requires` File.hasContent "/etc/default/hostapd"
[ "DAEMON_CONF=/etc/hostapd/hostapd.conf" ]
`onChange` Service.running "hostapd"
+ & Systemd.enabled "hostapd"
& File.hasContent "/etc/resolv.conf"
[ "domain kitenet.net"
, "search kitenet.net"
@@ -1103,7 +1104,7 @@ homeRouter = propertyList "home router" $ props
]
`before` File.hasPrivContent "/etc/ppp/pap-secrets" (Context "joeyh@arczip.com")
--- | Enable IP masqerading, on whatever other interfaces come up than the
+-- | Enable IP masqerading, on whatever other interfaces come up, besides the
-- provided intif.
ipmasq :: String -> Property DebianLike
ipmasq intif = File.hasContent ifupscript
@@ -1119,6 +1120,7 @@ ipmasq intif = File.hasContent ifupscript
, "echo 1 > /proc/sys/net/ipv4/ip_forward"
]
`before` scriptmode ifupscript
+ `before` File.dirExists (takeDirectory pppupscript)
`before` File.hasContent pppupscript
[ "#!/bin/sh"
, "IFACE=$PPP_IFACE " ++ ifupscript
@@ -1181,16 +1183,20 @@ devSoftware = Apt.installed
]
cubieTruckOneWire :: Property DebianLike
-cubieTruckOneWire =
- File.hasContent "/etc/easy-peasy-devicetree-squeezy/my.dts" mydts
- `onChange` utilitysetup
- `requires` utilityinstalled
+cubieTruckOneWire = utilitysetup
+ `requires` dtsinstalled
+ `requires` utilityinstalled
where
+ dtsinstalled = File.hasContent "/etc/easy-peasy-devicetree-squeezy/my.dts" mydts
+ `requires` File.dirExists "/etc/easy-peasy-devicetree-squeezy"
utilityinstalled = Git.cloned (User "root") "https://git.joeyh.name/git/easy-peasy-devicetree-squeezy.git" "/usr/local/easy-peasy-devicetree-squeezy" Nothing
`onChange` File.isSymlinkedTo "/usr/local/bin/easy-peasy-devicetree-squeezy" (File.LinkTarget "/usr/local/easy-peasy-devicetree-squeezy/easy-peasy-devicetree-squeezy")
- utilitysetup = cmdProperty "easy-peasy-devicetree-squeezy"
- ["--debian", "sun7i-a20-cubietruck"]
- `assume` MadeChange
+ `requires` Apt.installed ["pv", "device-tree-compiler", "cpp", "linux-source"]
+ utilitysetup = check (not <$> doesFileExist dtb) $
+ cmdProperty "easy-peasy-devicetree-squeezy"
+ ["--debian", "sun7i-a20-cubietruck"]
+ `assume` MadeChange
+ dtb = "/etc/flash-kernel/dtbs/sun7i-a20-cubietruck.dtb"
mydts =
[ "/* Device tree addition enabling onewire sensors on CubieTruck GPIO pin PC21 */"
, "#include <dt-bindings/gpio/gpio.h>"
@@ -1236,7 +1242,7 @@ newtype USBHubPort = USBHubPort Int
autoMountDrive :: Mount.Label -> USBHubPort -> Maybe FilePath -> Property DebianLike
autoMountDrive label (USBHubPort port) malias = propertyList desc $ props
& File.ownerGroup mountpoint (User "joey") (Group "joey")
- & File.dirExists mountpoint
+ `requires` File.dirExists mountpoint
& case malias of
Just t -> ("/media/joey/" ++ t) `File.isSymlinkedTo`
File.LinkTarget mountpoint
@@ -1277,7 +1283,7 @@ autoMountDrive label (USBHubPort port) malias = propertyList desc $ props
, "Description=Automount " ++ label
, "[Automount]"
, "Where=" ++ mountpoint
- , "TimeoutIdleSec=600"
+ , "TimeoutIdleSec=300"
, "[Install]"
, "WantedBy=multi-user.target"
]