Personal Nix setup

Move greetd/regreet over to hyprland rather than cage

Changed files
+71 -39
modules
+52 -37
modules/desktop/hyprland.nix
···
with lib;
let
cfg = config.modules.desktop;
+
+
mkConfig = input: monitor: pkgs.writeText "hyprland.conf" ''
+
debug {
+
error_position=1
+
}
+
+
general {
+
allow_tearing=true
+
}
+
+
input {
+
touchpad {
+
clickfinger_behavior=true
+
scroll_factor=0.180000
+
tap-and-drag=false
+
tap-to-click=false
+
}
+
kb_options=ctrl:nocaps,lv3:ralt_switch
+
kb_layout=${cfg.hyprland.input.kb_layout}
+
kb_model=${cfg.hyprland.input.kb_model}
+
kb_variant=${cfg.hyprland.input.kb_variant}
+
sensitivity=${toString cfg.hyprland.input.sensitivity}
+
}
+
+
misc {
+
disable_hyprland_logo=true
+
disable_splash_rendering=true
+
vrr=1
+
}
+
+
render {
+
direct_scanout=1
+
expand_undersized_textures=false
+
}
+
+
cursor {
+
sync_gsettings_theme=false
+
}
+
+
ecosystem {
+
no_update_news = true
+
no_donation_nag = true
+
}
+
+
${concatMapStringsSep "\n" (x: "monitor=${x}") cfg.hyprland.monitor}
+
monitor=, preferred, auto, 1
+
'';
in {
options.modules.desktop.hyprland = {
enable = mkOption {
···
default = [ ];
type = lib.types.listOf lib.types.str;
};
+
+
configFile = mkOption {
+
default = mkConfig cfg.hyprland.input cfg.hyprland.monitor;
+
};
};
config = mkIf cfg.hyprland.enable {
···
];
};
-
environment.etc."hypr/hyprland.conf".text = ''
-
debug {
-
error_position=1
-
}
-
-
general {
-
allow_tearing=true
-
}
-
-
input {
-
touchpad {
-
clickfinger_behavior=true
-
scroll_factor=0.180000
-
tap-and-drag=false
-
tap-to-click=false
-
}
-
kb_options=ctrl:nocaps,lv3:ralt_switch
-
kb_layout=${cfg.hyprland.input.kb_layout}
-
kb_model=${cfg.hyprland.input.kb_model}
-
kb_variant=${cfg.hyprland.input.kb_variant}
-
sensitivity=${toString cfg.hyprland.input.sensitivity}
-
}
-
-
misc {
-
disable_hyprland_logo=true
-
disable_splash_rendering=true
-
vrr=1
-
}
-
-
render {
-
direct_scanout=1
-
expand_undersized_textures=false
-
}
-
-
${concatMapStringsSep "\n" (x: "monitor=${x}") cfg.hyprland.monitor}
-
monitor=, preferred, auto, 1
-
'';
+
environment.etc."hypr/hyprland.conf".source = cfg.hyprland.configFile;
};
}
+19 -2
modules/desktop/session.nix
···
services = {
greetd = {
enable = true;
-
settings.terminal.vt = 1;
+
settings = {
+
terminal.vt = 1;
+
default_session.command = let
+
hyprConfig = pkgs.writeTextFile {
+
name = "hyprland-greeter.conf";
+
text = ''
+
source=${toString cfg.hyprland.configFile}
+
exec-once = ${getExe config.programs.regreet.package}; hyprctl dispatch exit
+
animations {
+
enabled = false
+
}
+
'';
+
};
+
in escapeShellArgs [
+
"${pkgs.dbus}/bin/dbus-run-session"
+
"${getExe pkgs.hyprland}"
+
"-c" (toString hyprConfig)
+
];
+
};
};
upower.enable = true;
gvfs.enable = true;
···
programs = {
regreet = {
enable = true;
-
cageArgs = [ "-s" "-mlast" ];
inherit cursorTheme iconTheme;
font = defaultFont;
theme = gtkTheme;