nixos-config/modules/regreet/default.nix

73 lines
1.5 KiB
Nix
Raw Normal View History

2024-06-03 12:19:01 +02:00
{
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
];
};
};
}