diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-07-17 12:51:40 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-07-17 12:51:40 -0400 |
| commit | 1522d270077abad43a6d8d7fea2bd8163ed912fd (patch) | |
| tree | ff9cdf4b9a12b4ad69fd8dece051e41de596e91f /src/Propellor/Property/LightDM.hs | |
| parent | b6d650730be9369b89623f46cb773dcc880630cb (diff) | |
Propellor.Property.LightDM.autoLogin: Made revertable.
* Propellor.Property.LightDM.autoLogin: Made revertable.
(minor API change)
* Propellor.Property.Conffile: Added lacksIniSetting.
This commit was sponsored by Jack Hill on Patreon.
Diffstat (limited to 'src/Propellor/Property/LightDM.hs')
| -rw-r--r-- | src/Propellor/Property/LightDM.hs | 14 |
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 |
