summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/LightDM.hs
diff options
context:
space:
mode:
authorJoey Hess2017-07-17 16:51:00 -0400
committerJoey Hess2017-07-17 16:51:00 -0400
commit7e53d16aa18f343de70830219095fbf8e1566a2f (patch)
treeb31044c089a6099a7b2ebfed27c3de6a21085f93 /src/Propellor/Property/LightDM.hs
parente2792f93555c0d35313c976604c4ee20f3dd36e2 (diff)
parentc987a3a3bd14171071b85c5937773a47b23859ff (diff)
Merge branch 'master' into joeyconfig
Diffstat (limited to 'src/Propellor/Property/LightDM.hs')
-rw-r--r--src/Propellor/Property/LightDM.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Propellor/Property/LightDM.hs b/src/Propellor/Property/LightDM.hs
index 44f0e9f0..d471d314 100644
--- a/src/Propellor/Property/LightDM.hs
+++ b/src/Propellor/Property/LightDM.hs
@@ -10,8 +10,12 @@ installed :: Property DebianLike
installed = Apt.installed ["lightdm"]
-- | Configures LightDM to skip the login screen and autologin as a user.
-autoLogin :: User -> Property DebianLike
-autoLogin (User u) = "/etc/lightdm/lightdm.conf" `ConfFile.containsIniSetting`
- ("Seat:*", "autologin-user", u)
- `describe` "lightdm autologin"
- `requires` installed
+autoLogin :: User -> RevertableProperty DebianLike DebianLike
+autoLogin (User u) = (setup <!> cleanup)
+ `describe` ("lightdm autologin for " ++ u)
+ where
+ cf = "/etc/lightdm/lightdm.conf"
+ setting = ("Seat:*", "autologin-user", u)
+ setup = cf `ConfFile.containsIniSetting` setting
+ `requires` installed
+ cleanup = tightenTargets $ cf `ConfFile.lacksIniSetting` setting