71 lines
2.1 KiB
Nix
71 lines
2.1 KiB
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
with lib;
|
|
let
|
|
cfg = config.modules.desktop.regreet;
|
|
in {
|
|
options.modules.desktop.regreet = {
|
|
enable = mkEnableOption "Enable regreet, a clean and customizable greeter for greetd";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.greetd = {
|
|
enable = true;
|
|
vt = 7;
|
|
settings = {
|
|
# TODO: probably should rewrite somehow,,,
|
|
# this is ugly, but it SOMEHOW WORKS??
|
|
# kind of beautiful in its own way
|
|
default_session = let
|
|
swayConfig = let
|
|
monitors = config.modules.desktop.monitors;
|
|
monitorConfig = if monitors.enable && (builtins.length monitors.monitors > 0) then
|
|
let
|
|
# TODO: rewrite primary monitor system
|
|
# it will get repetitive..
|
|
firstMonitor = builtins.head monitors.monitors;
|
|
in
|
|
"output ${firstMonitor.name} scale ${toString firstMonitor.scale}"
|
|
else
|
|
"";
|
|
in command: pkgs.writeText "kiosk-sway-config" ''
|
|
${monitorConfig}
|
|
xwayland disable
|
|
exec '${command}; ${pkgs.sway}/bin/swaymsg exit'
|
|
'';
|
|
swayKiosk = command: "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.sway} --unsupported-gpu --config ${swayConfig command}";
|
|
in {
|
|
command = swayKiosk (lib.getExe pkgs.greetd.regreet);
|
|
};
|
|
};
|
|
};
|
|
|
|
programs.regreet = {
|
|
enable = true;
|
|
settings = {
|
|
background = {
|
|
path = "${../../assets/lockscreen.png}";
|
|
fit = "Cover";
|
|
};
|
|
};
|
|
# TODO: move to theme module
|
|
theme = with config.modules.desktop.themes.gtkTheme; {
|
|
name = name;
|
|
package = package;
|
|
};
|
|
iconTheme = with config.modules.desktop.themes.iconTheme; {
|
|
name = name;
|
|
package = package;
|
|
};
|
|
cursorTheme = with config.modules.desktop.themes.cursorTheme; {
|
|
name = name;
|
|
package = package;
|
|
};
|
|
font = with config.modules.desktop.fonts.fonts.sansSerif; {
|
|
name = family;
|
|
size = size;
|
|
package = package;
|
|
};
|
|
};
|
|
};
|
|
}
|