Move regreet to separate module

This commit is contained in:
Erwin Boskma 2024-06-03 12:19:01 +02:00
parent 766712f7e7
commit 42c5dfc62d
Signed by: erwin
SSH key fingerprint: SHA256:/Wk1WZdLg+vQHs3in9qq7PsIp8SMzwGSk/RLZ5zPuZk
2 changed files with 72 additions and 31 deletions

View file

@ -71,39 +71,8 @@ in
};
};
programs.regreet = {
enable = false;
settings = {
background = {
path = cfg.wallpaper;
fit = "Cover";
};
GTK = {
application_prefer_dark_theme = true;
theme_name = "elementary";
cursor_theme = "elementary";
icon_theme_name = "elementary";
font_name = "Iosevka Aile 16";
};
commands = {
reboot = [
"systemctl"
"reboot"
];
poweroff = [
"systemctl"
"poweroff"
];
};
};
};
security.pam.services.greetd.u2fAuth = false;
# exec "${pkgs.greetd.regreet}/bin/regreet; swaymsg exit"
networking.firewall.allowedTCPPorts = lib.mkIf (cfg.wayvnc && !config.services.tailscale.enable) [
5900
];

View file

@ -0,0 +1,72 @@
{
pkgs,
config,
lib,
...
}:
with lib;
let
cfg = config.eboskma.regreet;
regreetWrapper = pkgs.writeShellScriptBin "regreet-wrapper" (
lib.concatStringsSep "\n" (lib.optional cfg.wayvnc "${pkgs.wayvnc}/bin/wayvnc 0.0.0.0 &")
++ [
toString
(lib.getExe pkgs.greetd.regreet)
]
);
in
{
options.eboskma.regreet = {
enable = mkEnableOption "regreet";
wayvnc = mkEnableOption "wayvnc";
wallpaper = mkOption {
description = "Path to an image to use as wallpaper";
type = types.path;
};
};
config = mkIf cfg.enable {
programs.regreet = {
enable = true;
package = regreetWrapper;
settings = {
background = {
path = cfg.wallpaper;
fit = "Cover";
};
GTK = {
application_prefer_dark_theme = true;
theme_name = "elementary";
cursor_theme = "elementary";
icon_theme_name = "elementary";
font_name = "Iosevka Aile 16";
};
commands = {
reboot = [
"systemctl"
"reboot"
];
poweroff = [
"systemctl"
"poweroff"
];
};
};
};
security.pam.services.greetd.u2fAuth = false;
networking.firewall.allowedTCPPorts = lib.mkIf (cfg.wayvnc && !config.services.tailscale.enable) [
5900
];
environment = {
systemPackages = with pkgs; [
pantheon.elementary-gtk-theme
pantheon.elementary-icon-theme
];
};
};
}