nixos/xserver: improve DM error message when X off
Previously, if you, for example, set services.xserver.displayManager.sddm.enable, but forgot to set services.xserver.enable, you would get an error message that looked like this: error: attribute 'display-manager' missing Which was not particularly helpful. Using assertions, we can make this message much better.
This commit is contained in:
parent
753e1e0bab
commit
7658c90f21
@ -189,6 +189,11 @@ in
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
assertions = [
|
assertions = [
|
||||||
|
{ assertion = xcfg.enable;
|
||||||
|
message = ''
|
||||||
|
LightDM requires services.xserver.enable to be true
|
||||||
|
'';
|
||||||
|
}
|
||||||
{ assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
|
{ assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
|
||||||
message = ''
|
message = ''
|
||||||
LightDM auto-login requires services.xserver.displayManager.lightdm.autoLogin.user to be set
|
LightDM auto-login requires services.xserver.displayManager.lightdm.autoLogin.user to be set
|
||||||
|
@ -195,6 +195,11 @@ in
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
assertions = [
|
assertions = [
|
||||||
|
{ assertion = xcfg.enable;
|
||||||
|
message = ''
|
||||||
|
SDDM requires services.xserver.enable to be true
|
||||||
|
'';
|
||||||
|
}
|
||||||
{ assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
|
{ assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
|
||||||
message = ''
|
message = ''
|
||||||
SDDM auto-login requires services.xserver.displayManager.sddm.autoLogin.user to be set
|
SDDM auto-login requires services.xserver.displayManager.sddm.autoLogin.user to be set
|
||||||
@ -264,8 +269,8 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."sddm.conf".source = cfgFile;
|
environment.etc."sddm.conf".source = cfgFile;
|
||||||
environment.pathsToLink = [
|
environment.pathsToLink = [
|
||||||
"/share/sddm"
|
"/share/sddm"
|
||||||
];
|
];
|
||||||
|
|
||||||
users.groups.sddm.gid = config.ids.gids.sddm;
|
users.groups.sddm.gid = config.ids.gids.sddm;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user