nixos-config/modules/regreet/default.nix

85 lines
1.8 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;
settings = {
background = {
path = cfg.wallpaper;
fit = "Cover";
};
GTK = {
application_prefer_dark_theme = true;
2024-06-08 16:02:42 +02:00
theme_name = "Orchis-Dark";
cursor_theme = "Catppuccin-Mocha-Dark-Cursors";
2024-06-03 12:19:01 +02:00
icon_theme_name = "elementary";
2024-06-08 16:02:42 +02:00
font_name = "Monaspace Neon 16";
2024-06-03 12:19:01 +02:00
};
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
];
};
};
}