2022-04-27 00:21:19 +02:00
|
|
|
{ pkgs
|
|
|
|
, config
|
|
|
|
, lib
|
|
|
|
, ...
|
2022-03-01 22:19:03 +01:00
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.eboskma.greetd;
|
2023-09-29 11:52:45 +02:00
|
|
|
steamCfg = config.programs.steam;
|
2022-07-03 22:43:40 +02:00
|
|
|
|
2023-09-29 11:52:45 +02:00
|
|
|
# style = builtins.replaceStrings [ "{WALLPAPER}" ] [ (builtins.toString ../../home-manager/modules/sway/wallpapers/river-2560.png) ] (builtins.readFile ./greetd.css);
|
|
|
|
wallpaper = ../../home-manager/modules/sway/wallpapers/river-2560.png;
|
|
|
|
style = builtins.readFile ./greetd.css;
|
2022-10-30 22:19:50 +01:00
|
|
|
|
2023-09-29 11:52:45 +02:00
|
|
|
swaySession = pkgs.writeShellScript "sway-session" ''
|
|
|
|
${pkgs.sway}/bin/sway --unsupported-gpu
|
|
|
|
'';
|
|
|
|
|
|
|
|
steam-gamescope =
|
|
|
|
let
|
|
|
|
exports = builtins.attrValues (builtins.mapAttrs (n: v: "export ${n}=${v}") steamCfg.gamescopeSession.env);
|
|
|
|
in
|
|
|
|
pkgs.writeShellScriptBin "steam-gamescope" ''
|
|
|
|
${builtins.concatStringsSep "\n" exports}
|
|
|
|
gamescope --steam ${toString steamCfg.gamescopeSession.args} -- steam -tenfoot -pipewire-dmabuf
|
|
|
|
'';
|
2022-04-27 00:21:19 +02:00
|
|
|
in
|
|
|
|
{
|
2021-11-17 16:32:18 +01:00
|
|
|
options.eboskma.greetd = {
|
|
|
|
enable = mkEnableOption "enable greetd";
|
2022-11-19 20:00:54 +01:00
|
|
|
sway = mkEnableOption "sway";
|
2023-09-29 11:52:45 +02:00
|
|
|
steam = mkEnableOption "steam";
|
|
|
|
wayvnc = mkEnableOption "wayvnc";
|
2021-11-17 16:32:18 +01:00
|
|
|
};
|
|
|
|
|
2022-03-18 21:14:51 +01:00
|
|
|
config =
|
2022-05-03 18:17:38 +02:00
|
|
|
mkIf cfg.enable
|
2022-04-27 00:21:19 +02:00
|
|
|
{
|
|
|
|
services.greetd = {
|
|
|
|
enable = true;
|
|
|
|
restart = true;
|
|
|
|
settings = {
|
|
|
|
default_session = {
|
2022-11-11 17:07:24 +01:00
|
|
|
command = "${pkgs.sway}/bin/sway --unsupported-gpu --config /etc/greetd/sway-config";
|
2022-04-27 00:21:19 +02:00
|
|
|
};
|
2022-03-18 21:14:51 +01:00
|
|
|
};
|
2021-11-17 16:32:18 +01:00
|
|
|
};
|
2023-09-13 23:57:47 +02:00
|
|
|
|
|
|
|
programs.regreet = {
|
2023-09-29 11:52:45 +02:00
|
|
|
enable = false;
|
2023-09-13 23:57:47 +02:00
|
|
|
settings = {
|
|
|
|
background = {
|
|
|
|
path = ../../home-manager/modules/sway/wallpapers/river-2560.png;
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
2023-09-29 11:52:45 +02:00
|
|
|
# exec "${pkgs.greetd.regreet}/bin/regreet; swaymsg exit"
|
2021-11-17 16:32:18 +01:00
|
|
|
|
2023-09-29 11:52:45 +02:00
|
|
|
networking.firewall.allowedTCPPorts = lib.mkIf cfg.wayvnc [ 5900 ];
|
|
|
|
|
|
|
|
environment = {
|
|
|
|
systemPackages = with pkgs; [ pantheon.elementary-gtk-theme pantheon.elementary-icon-theme ];
|
|
|
|
etc = {
|
|
|
|
"greetd/sway-config" = {
|
|
|
|
text = lib.concatStringsSep "\n"
|
|
|
|
((lib.optional cfg.wayvnc "exec ${pkgs.wayvnc}/bin/wayvnc -g 0.0.0.0") ++
|
|
|
|
[
|
|
|
|
''
|
|
|
|
exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -s /etc/greetd/gtkgreet.css -b ${wallpaper}; swaymsg exit"
|
|
|
|
include /etc/sway/config.d/*
|
|
|
|
''
|
|
|
|
]);
|
|
|
|
user = "greeter";
|
|
|
|
group = "greeter";
|
|
|
|
};
|
|
|
|
"greetd/environments" = {
|
|
|
|
text = concatStringsSep "\n" ((optional cfg.sway "${swaySession}")
|
|
|
|
++ (optional cfg.steam "${steam-gamescope}")
|
|
|
|
++ [
|
|
|
|
"${pkgs.bash}/bin/bash"
|
|
|
|
]);
|
|
|
|
user = "greeter";
|
|
|
|
group = "greeter";
|
|
|
|
};
|
|
|
|
"greetd/gtkgreet.css" = {
|
|
|
|
text = style;
|
|
|
|
user = "greeter";
|
|
|
|
group = "greeter";
|
|
|
|
};
|
|
|
|
"sway/config.d/systemd-env.conf" = {
|
|
|
|
text = ''
|
|
|
|
exec_always --no-startup-id systemctl --user import-environment _JAVA_AWT_WM_NONREPARENTING MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_WAYLAND_DISABLE_WINDOWDECORATION QT_QPA_PLATFORMTHEME SDL_VIDEODRIVER SSH_AUTH_SOCK
|
|
|
|
exec_always --no-startup-id dbus-update-activation-environment --systemd _JAVA_AWT_WM_NONREPARENTING MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_WAYLAND_DISABLE_WINDOWDECORATION QT_QPA_PLATFORMTHEME SDL_VIDEODRIVER SSH_AUTH_SOCK
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
"xdg/gtk-3.0/settings.ini" = {
|
|
|
|
text = generators.toINI { } {
|
|
|
|
Settings = {
|
|
|
|
gtk-theme-name = "elementary";
|
|
|
|
gtk-icon-theme-name = "elementary";
|
|
|
|
gtk-cursor-theme-name = "elementary";
|
|
|
|
gtk-application-prefer-dark-theme = "true";
|
|
|
|
};
|
2023-09-06 17:01:26 +02:00
|
|
|
};
|
|
|
|
};
|
2023-09-29 11:52:45 +02:00
|
|
|
"xdg/gtk-4.0/settings.ini" = {
|
|
|
|
text = generators.toINI { } {
|
|
|
|
Settings = {
|
|
|
|
gtk-theme-name = "elementary";
|
|
|
|
gtk-icon-theme-name = "elementary";
|
|
|
|
gtk-cursor-theme-name = "elementary";
|
|
|
|
gtk-application-prefer-dark-theme = "true";
|
|
|
|
};
|
2022-04-27 00:21:19 +02:00
|
|
|
};
|
2022-03-18 21:14:51 +01:00
|
|
|
};
|
2022-01-03 13:03:10 +01:00
|
|
|
};
|
|
|
|
};
|
2021-11-17 16:32:18 +01:00
|
|
|
};
|
|
|
|
}
|