nixos-configs/nixosModules/desktop/manager/default.nix
matt1432 ab8bb48feb
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(ags): remove unneeded agsV1 stuff
2024-11-12 16:55:57 -05:00

60 lines
1.2 KiB
Nix

self: {
config,
lib,
pkgs,
...
}: {
imports = [
(import ./ags.nix self)
(import ./hyprland.nix self)
];
config = let
inherit (lib) mkIf;
cfg = config.roles.desktop;
hyprland =
config
.home-manager
.users
.${cfg.user}
.wayland
.windowManager
.hyprland
.finalPackage;
# Hide TTY on launch
cmd = toString (pkgs.writeShellScript "hyprland-wrapper" ''
trap 'systemctl --user stop hyprland-session.target; sleep 1' EXIT
exec Hyprland >/dev/null
'');
in
mkIf cfg.displayManager.enable {
services = {
displayManager.sessionPackages = [hyprland];
greetd = {
enable = true;
settings = {
default_session = {
command = cmd;
user = "greeter";
};
initial_session = {
command = cmd;
user = cfg.user;
};
};
};
};
# unlock GPG keyring on login
services.gnome.gnome-keyring.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true;
};
# For accurate stack trace
_file = ./default.nix;
}