add greetd module

This commit is contained in:
Anthony Rodriguez 2024-09-06 03:43:59 +02:00
parent d0dc70b011
commit 48810564b1
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
5 changed files with 46 additions and 3 deletions

View file

@ -1,8 +1,5 @@
{ inputs, pkgs, ... }:
{
imports = [
./waybar.nix
];
wayland.windowManager.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;

View file

@ -40,6 +40,7 @@
};
wantedBy = ["multi-user.target"];
};
modules.gnome.enable = true;
modules.nvidia.enable = true;
modules.gaming.enable = true;

View file

@ -22,5 +22,6 @@
};
};
modules.hyprland.enable = true;
modules.greetd.enable = true;
}

View file

@ -8,5 +8,6 @@ _:
./gaming.nix
./stylix.nix
./hyprland.nix
./greetd.nix
];
}

43
modules/greetd.nix Normal file
View file

@ -0,0 +1,43 @@
{ inputs, config, lib, pkgs, ... }:
let
cfg = config.modules.greetd;
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
greeter = lib.getExe config.programs.regreet.package;
Hyprland = lib.getExe' hyprland "Hyprland";
hyprctl = lib.getExe' hyprland "hyprctl";
hyprlandConfig = pkgs.writeText "greetd-hyprland-config" ''
misc {
force_default_wallpaper=0
focus_on_activate=1
}
animations {
enabled=0
first_launch_animation=0
}
exec-once=${greeter}; ${hyprctl} dispatch exit
exec-once=${hyprctl} dispatch focuswindow ${greeter}
'';
in
{
options = {
modules.greetd = {
enable = lib.mkEnableOption "Enable the greetd module";
};
};
config = lib.mkIf cfg.enable {
programs.regreet.enable = true;
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = "${Hyprland} --config ${hyprlandConfig}";
user = "nezia";
};
default_session = initial_session;
};
};
};
}