mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
nixos/sddm: add setupScript and stopScript options
These options allow setting the start and stop scripts for the display manager. Making these configurable is necessary to allow some hardware configurations. Upstream ships empty scripts by default, anyway.
This commit is contained in:
parent
f7edf63b23
commit
b07fa98f82
@ -17,6 +17,16 @@ let
|
||||
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" ''
|
||||
[General]
|
||||
HaltCommand=${pkgs.systemd}/bin/systemctl poweroff
|
||||
@ -39,6 +49,8 @@ let
|
||||
SessionCommand=${dmcfg.session.script}
|
||||
SessionDir=${dmcfg.session.desktops}
|
||||
XauthPath=${pkgs.xorg.xauth}/bin/xauth
|
||||
DisplayCommand=${Xsetup}
|
||||
DisplayStopCommand=${Xstop}
|
||||
|
||||
${optionalString cfg.autoLogin.enable ''
|
||||
[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 {
|
||||
default = {};
|
||||
description = ''
|
||||
|
Loading…
Reference in New Issue
Block a user