2024-04-22 23:14:28 -04:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
options = {
|
|
|
|
alyraffauf.desktop.greetd.enable =
|
|
|
|
lib.mkEnableOption "Enable greetd.";
|
|
|
|
alyraffauf.desktop.greetd.session = lib.mkOption {
|
|
|
|
description = "Default command to execute on login.";
|
2024-05-05 19:44:51 -04:00
|
|
|
default = lib.getExe config.programs.hyprland.package;
|
2024-04-22 23:14:28 -04:00
|
|
|
type = lib.types.str;
|
|
|
|
};
|
2024-05-01 17:44:08 -04:00
|
|
|
alyraffauf.desktop.greetd.autologin.enable = lib.mkOption {
|
|
|
|
description = "Whether to enable autologin.";
|
|
|
|
default = false;
|
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
|
|
|
alyraffauf.desktop.greetd.autologin.user = lib.mkOption {
|
|
|
|
description = "User to autologin.";
|
|
|
|
default = "aly";
|
|
|
|
type = lib.types.str;
|
|
|
|
};
|
2024-04-22 23:14:28 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf config.alyraffauf.desktop.greetd.enable {
|
|
|
|
services = {
|
|
|
|
greetd = {
|
|
|
|
enable = true;
|
2024-05-02 19:00:26 -04:00
|
|
|
settings =
|
|
|
|
if config.alyraffauf.desktop.greetd.autologin.enable
|
|
|
|
then {
|
|
|
|
default_session = {
|
2024-05-05 19:44:51 -04:00
|
|
|
command = lib.mkDefault "${lib.getExe pkgs.greetd.tuigreet} --asterisks -g 'Welcome to NixOS ${config.system.nixos.release}' --time --remember --cmd ${config.alyraffauf.desktop.greetd.session}";
|
2024-05-02 19:00:26 -04:00
|
|
|
};
|
|
|
|
initial_session = {
|
2024-05-01 17:44:08 -04:00
|
|
|
command = config.alyraffauf.desktop.greetd.session;
|
|
|
|
user = config.alyraffauf.desktop.greetd.autologin.user;
|
2024-05-02 19:00:26 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
default_session = {
|
2024-05-05 19:44:51 -04:00
|
|
|
command = lib.mkDefault "${lib.getExe pkgs.greetd.tuigreet} --asterisks -g 'Welcome to NixOS ${config.system.nixos.release}' --time --remember --cmd ${config.alyraffauf.desktop.greetd.session}";
|
2024-05-02 19:00:26 -04:00
|
|
|
};
|
|
|
|
};
|
2024-04-22 23:14:28 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|