Move regreet to separate module
This commit is contained in:
parent
766712f7e7
commit
42c5dfc62d
2 changed files with 72 additions and 31 deletions
|
@ -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
|
||||
];
|
||||
|
|
72
modules/regreet/default.nix
Normal file
72
modules/regreet/default.nix
Normal 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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue