Merge pull request #11660 from ttuegel/sddm-scripts
Configurable SDDM scripts
This commit is contained in:
commit
ce9e17b784
@ -17,6 +17,16 @@ let
|
|||||||
exec ${dmcfg.xserverBin} ${dmcfg.xserverArgs} "$@"
|
exec ${dmcfg.xserverBin} ${dmcfg.xserverArgs} "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Xsetup = pkgs.writeScript "Xsetup" ''
|
||||||
|
#!/bin/sh
|
||||||
|
${cfg.setupScript}
|
||||||
|
'';
|
||||||
|
|
||||||
|
Xstop = pkgs.writeScript "Xstop" ''
|
||||||
|
#!/bin/sh
|
||||||
|
${cfg.stopScript}
|
||||||
|
'';
|
||||||
|
|
||||||
cfgFile = pkgs.writeText "sddm.conf" ''
|
cfgFile = pkgs.writeText "sddm.conf" ''
|
||||||
[General]
|
[General]
|
||||||
HaltCommand=${pkgs.systemd}/bin/systemctl poweroff
|
HaltCommand=${pkgs.systemd}/bin/systemctl poweroff
|
||||||
@ -39,6 +49,8 @@ let
|
|||||||
SessionCommand=${dmcfg.session.script}
|
SessionCommand=${dmcfg.session.script}
|
||||||
SessionDir=${dmcfg.session.desktops}
|
SessionDir=${dmcfg.session.desktops}
|
||||||
XauthPath=${pkgs.xorg.xauth}/bin/xauth
|
XauthPath=${pkgs.xorg.xauth}/bin/xauth
|
||||||
|
DisplayCommand=${Xsetup}
|
||||||
|
DisplayStopCommand=${Xstop}
|
||||||
|
|
||||||
${optionalString cfg.autoLogin.enable ''
|
${optionalString cfg.autoLogin.enable ''
|
||||||
[Autologin]
|
[Autologin]
|
||||||
@ -98,6 +110,27 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setupScript = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
example = ''
|
||||||
|
# workaround for using NVIDIA Optimus without Bumblebee
|
||||||
|
xrandr --setprovideroutputsource modesetting NVIDIA-0
|
||||||
|
xrandr --auto
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
A script to execute when starting the display server.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
stopScript = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
A script to execute when stopping the display server.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
autoLogin = mkOption {
|
autoLogin = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
description = ''
|
description = ''
|
||||||
@ -105,7 +138,7 @@ in
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
type = types.submodule {
|
type = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@ -130,7 +163,7 @@ in
|
|||||||
will work only the first time.
|
will work only the first time.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -142,14 +175,16 @@ in
|
|||||||
|
|
||||||
assertions = [
|
assertions = [
|
||||||
{ assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
|
{ assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
|
||||||
message = "SDDM auto-login requires services.xserver.displayManager.sddm.autoLogin.user to be set";
|
message = ''
|
||||||
|
SDDM auto-login requires services.xserver.displayManager.sddm.autoLogin.user to be set
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
{ assertion = cfg.autoLogin.enable -> elem defaultSessionName dmcfg.session.names;
|
{ assertion = cfg.autoLogin.enable -> elem defaultSessionName dmcfg.session.names;
|
||||||
message = ''
|
message = ''
|
||||||
SDDM auto-login requires that services.xserver.desktopManager.default and
|
SDDM auto-login requires that services.xserver.desktopManager.default and
|
||||||
services.xserver.windowMananger.default are set to valid values. The current
|
services.xserver.windowMananger.default are set to valid values. The current
|
||||||
default session: ${defaultSessionName} is not valid.
|
default session: ${defaultSessionName} is not valid.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -45,6 +45,11 @@ let
|
|||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# remove empty scripts
|
||||||
|
rm "$out/share/sddm/scripts/Xsetup" "$out/share/sddm/scripts/Xstop"
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "QML based X11 display manager";
|
description = "QML based X11 display manager";
|
||||||
homepage = https://github.com/sddm/sddm;
|
homepage = https://github.com/sddm/sddm;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user