{ pkgs, config, lib, ... }: with lib; let cfg = config.eboskma.regreet; regreetWrapperText = lib.concatStringsSep "\n" ( (lib.optional cfg.wayvnc "${pkgs.wayvnc}/bin/wayvnc 0.0.0.0 &") ++ [ "${lib.getExe pkgs.greetd.regreet}" ] ); regreetWrapper = pkgs.writeShellScriptBin "regreet-wrapper" regreetWrapperText; 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; theme = { name = "Orchis-Dark"; package = pkgs.orchis-theme.override { tweaks = [ "compact" "macos" ]; border-radius = 5; }; }; iconTheme = { name = "elementary"; package = pkgs.pantheon.elementary-icon-theme; }; cursorTheme = { name = "catppuccin-mocha-dark-cursors"; package = pkgs.catppuccin-cursors.mochaDark; }; font = { name = "Monaspace Neon"; size = 16; package = pkgs.monaspace; }; settings = { background = { path = cfg.wallpaper; fit = "Cover"; }; commands = { reboot = [ "systemctl" "reboot" ]; poweroff = [ "systemctl" "poweroff" ]; }; }; cageArgs = [ "-s" "-m" "last" ]; }; security.pam.services.greetd.u2fAuth = false; networking.firewall.allowedTCPPorts = lib.mkIf (cfg.wayvnc && !config.services.tailscale.enable) [ 5900 ]; environment = { systemPackages = with pkgs; [ (orchis-theme.override { tweaks = [ "black" "compact" "macos" ]; border-radius = 5; }) catppuccin-cursors.mochaDark pantheon.elementary-icon-theme ]; }; }; }