nixosmodules/greetd: simplify autologin options

This commit is contained in:
Aly Raffauf 2024-07-10 20:30:11 -04:00
parent b0f814a6bd
commit 17f721d33b
6 changed files with 10 additions and 30 deletions

View file

@ -38,11 +38,7 @@
desktop = { desktop = {
greetd = { greetd = {
enable = true; enable = true;
autologin = "aly";
autologin = {
enable = true;
user = "aly";
};
}; };
hyprland.enable = true; hyprland.enable = true;

View file

@ -111,11 +111,7 @@ in {
desktop = { desktop = {
greetd = { greetd = {
enable = true; enable = true;
autologin = "aly";
autologin = {
enable = true;
user = "aly";
};
}; };
hyprland.enable = true; hyprland.enable = true;

View file

@ -60,11 +60,7 @@
desktop = { desktop = {
greetd = { greetd = {
enable = true; enable = true;
autologin = "aly";
autologin = {
enable = true;
user = "aly";
};
}; };
hyprland.enable = true; hyprland.enable = true;

View file

@ -34,11 +34,7 @@
desktop = { desktop = {
greetd = { greetd = {
enable = true; enable = true;
autologin = "aly";
autologin = {
enable = true;
user = "aly";
};
}; };
hyprland.enable = true; hyprland.enable = true;

View file

@ -15,14 +15,14 @@
greetd = { greetd = {
enable = true; enable = true;
settings = settings =
if config.ar.desktop.greetd.autologin.enable if config.ar.desktop.greetd.autologin != null
then { then {
default_session = { default_session = {
command = lib.mkDefault "${lib.getExe pkgs.greetd.tuigreet} --asterisks --user-menu -g 'Welcome to NixOS ${config.system.nixos.release}' --time --remember --cmd ${config.ar.desktop.greetd.session}"; command = lib.mkDefault "${lib.getExe pkgs.greetd.tuigreet} --asterisks --user-menu -g 'Welcome to NixOS ${config.system.nixos.release}' --time --remember --cmd ${config.ar.desktop.greetd.session}";
}; };
initial_session = { initial_session = {
command = config.ar.desktop.greetd.session; command = config.ar.desktop.greetd.session;
user = config.ar.desktop.greetd.autologin.user; user = config.ar.desktop.greetd.autologin;
}; };
} }
else { else {

View file

@ -20,14 +20,10 @@
greetd = { greetd = {
enable = lib.mkEnableOption "Greetd display manager."; enable = lib.mkEnableOption "Greetd display manager.";
autologin = { autologin = lib.mkOption {
enable = lib.mkEnableOption "Whether to enable autologin.";
user = lib.mkOption {
description = "User to autologin."; description = "User to autologin.";
default = "aly"; default = null;
type = lib.types.str; type = lib.types.nullOr lib.types.str;
};
}; };
session = lib.mkOption { session = lib.mkOption {