    -- | Maintainer: Sean Whitton <spwhitton@spwhitton.name>

    module Propellor.Property.LightDM where

    import Propellor.Base
    import qualified Propellor.Property.Apt as Apt
    import qualified Propellor.Property.ConfFile as ConfFile

    installed :: Property DebianLike
    installed :: Property DebianLike
    installed = [Package] -> Property DebianLike
    Apt.installed ["lightdm"]

    -- | Configures LightDM to skip the login screen and autologin as a user.
    autoLogin :: User -> RevertableProperty DebianLike DebianLike
    autoLogin :: User -> RevertableProperty DebianLike DebianLike
    autoLogin (User u :: Package
    u) = (Property DebianLike
    setup Property DebianLike
    -> Property DebianLike -> RevertableProperty DebianLike DebianLike
    forall setupmetatypes undometatypes.
    Property setupmetatypes
    -> Property undometatypes
    -> RevertableProperty setupmetatypes undometatypes
    <!> Property DebianLike
    cleanup)
    	RevertableProperty DebianLike DebianLike
    -> Package -> RevertableProperty DebianLike DebianLike
    forall p. IsProp p => p -> Package -> p
    `describe` ("lightdm autologin for " Package -> Package -> Package
    forall a. [a] -> [a] -> [a]
    ++ Package
    u)
      where
    	cf :: Package
    cf = "/etc/lightdm/lightdm.conf"
    	setting :: (Package, Package, Package)
    setting = ("Seat:*", "autologin-user", Package
    u)
    	setup :: CombinedType (Property UnixLike) (Property DebianLike)
    setup = Package
    cf Package -> (Package, Package, Package) -> Property UnixLike
    `ConfFile.containsIniSetting` (Package, Package, Package)
    setting
    		Property UnixLike
    -> Property DebianLike
    -> CombinedType (Property UnixLike) (Property DebianLike)
    forall x y. Combines x y => x -> y -> CombinedType x y
    `requires` Property DebianLike
    installed
    	cleanup :: Property DebianLike
    cleanup = Property UnixLike -> Property DebianLike
    forall (p :: * -> *) (untightened :: [MetaType])
           (tightened :: [MetaType]).
    (TightenTargets p, TightenTargetsAllowed untightened tightened,
     SingI tightened) =>
    p (MetaTypes untightened) -> p (MetaTypes tightened)
    tightenTargets (Property UnixLike -> Property DebianLike)
    -> Property UnixLike -> Property DebianLike
    forall a b. (a -> b) -> a -> b
    $ Package
    cf Package -> (Package, Package, Package) -> Property UnixLike
    `ConfFile.lacksIniSetting` (Package, Package, Package)
    setting