nixos-config/modules/regreet/default.nix

104 lines
2.1 KiB
Nix
Raw Normal View History

2024-06-03 12:19:01 +02:00
{
pkgs,
config,
lib,
...
}:
with lib;
let
cfg = config.eboskma.regreet;
2024-06-04 09:42:03 +02:00
regreetWrapperText = lib.concatStringsSep "\n" (
(lib.optional cfg.wayvnc "${pkgs.wayvnc}/bin/wayvnc 0.0.0.0 &")
++ [ "${lib.getExe pkgs.greetd.regreet}" ]
2024-06-03 12:19:01 +02:00
);
2024-06-04 09:42:03 +02:00
regreetWrapper = pkgs.writeShellScriptBin "regreet-wrapper" regreetWrapperText;
2024-06-03 12:19:01 +02:00
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;
};
2024-06-03 12:19:01 +02:00
settings = {
background = {
path = cfg.wallpaper;
fit = "Cover";
};
commands = {
reboot = [
"systemctl"
"reboot"
];
poweroff = [
"systemctl"
"poweroff"
];
};
};
2024-06-08 16:02:42 +02:00
cageArgs = [
"-s"
"-m"
"last"
];
2024-06-03 12:19:01 +02:00
};
security.pam.services.greetd.u2fAuth = false;
networking.firewall.allowedTCPPorts = lib.mkIf (cfg.wayvnc && !config.services.tailscale.enable) [
5900
];
environment = {
systemPackages = with pkgs; [
2024-06-08 16:02:42 +02:00
(orchis-theme.override {
tweaks = [
"black"
"compact"
"macos"
];
border-radius = 5;
})
catppuccin-cursors.mochaDark
2024-06-03 12:19:01 +02:00
pantheon.elementary-icon-theme
];
};
};
}