nix-config/hosts/common/optional/greetd.nix

44 lines
1.2 KiB
Nix
Raw Normal View History

{ pkgs, lib, config, ... }:
let
homeCfgs = config.home-manager.users;
homePaths = lib.mapAttrsToList (n: v: "${v.home.path}/share") homeCfgs;
extraDataPaths = lib.concatStringsSep ":" homePaths;
vars = ''XDG_DATA_DIRS="$XDG_DATA_DIRS:${extraDataPaths}"'';
sway-kiosk = command: "${pkgs.sway}/bin/sway --config ${pkgs.writeText "kiosk.config" ''
output * bg #000000 solid_color
exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"
xwayland disable
input "type:touchpad" {
tap enabled
}
exec '${vars} ${command} -l debug; ${pkgs.sway}/bin/swaymsg exit'
''}";
2023-09-19 17:05:08 +00:00
gburdCfg = homeCfgs.gburd;
in
{
users.extraUsers.greeter.packages = [
2023-09-19 17:05:08 +00:00
gburdCfg.gtk.theme.package
gburdCfg.gtk.iconTheme.package
];
programs.regreet = {
enable = true;
settings = {
GTK = {
icon_theme_name = "ePapirus";
2023-09-19 17:05:08 +00:00
theme_name = gburdCfg.gtk.theme.name;
};
background = {
2023-09-19 17:05:08 +00:00
path = gburdCfg.wallpaper;
fit = "Cover";
};
};
};
services.greetd = {
enable = true;
settings.default_session.command = sway-kiosk (lib.getExe config.programs.regreet.package);
};
}