2024-02-10 21:27:29 -05:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
|
|
|
boolToString
|
|
|
|
concatStringsSep
|
|
|
|
filterAttrs
|
|
|
|
hasPrefix
|
|
|
|
isAttrs
|
|
|
|
isBool
|
|
|
|
mapAttrsToList
|
|
|
|
optionalString
|
|
|
|
;
|
|
|
|
|
|
|
|
inherit (import ./setupMonitors.nix {inherit config pkgs;}) setupMonitors;
|
|
|
|
|
2024-06-27 00:56:27 -04:00
|
|
|
cfg = config.roles.desktop;
|
|
|
|
|
2024-02-10 21:27:29 -05:00
|
|
|
# Nix stuff
|
2024-06-24 12:30:49 -04:00
|
|
|
cfgHypr =
|
|
|
|
config
|
|
|
|
.home-manager
|
|
|
|
.users
|
2024-06-27 00:56:27 -04:00
|
|
|
.${cfg.user}
|
2024-06-24 12:30:49 -04:00
|
|
|
.wayland
|
|
|
|
.windowManager
|
|
|
|
.hyprland;
|
2024-02-10 21:27:29 -05:00
|
|
|
|
|
|
|
devices = filterAttrs (n: v: hasPrefix "device:" n) cfgHypr.settings;
|
|
|
|
monitors = cfgHypr.settings.monitor;
|
|
|
|
inputs = cfgHypr.settings.input;
|
|
|
|
misc = cfgHypr.settings.misc;
|
|
|
|
|
|
|
|
mkHyprBlock = attrs:
|
|
|
|
concatStringsSep "\n" (mapAttrsToList (
|
|
|
|
n: v:
|
|
|
|
if (isAttrs v)
|
|
|
|
then ''
|
|
|
|
${n} {
|
|
|
|
${mkHyprBlock v}
|
|
|
|
}
|
|
|
|
''
|
|
|
|
else if (isBool v)
|
|
|
|
then " ${n}=${boolToString v}"
|
|
|
|
else " ${n}=${toString v}"
|
|
|
|
)
|
|
|
|
attrs);
|
|
|
|
in {
|
|
|
|
hyprConf = pkgs.writeText "greetd-hypr-config" (
|
2024-03-03 17:34:21 -05:00
|
|
|
(optionalString config.nvidia.enable
|
2024-06-09 22:49:30 -04:00
|
|
|
# hyprlang
|
2024-02-10 21:27:29 -05:00
|
|
|
''
|
|
|
|
env = LIBVA_DRIVER_NAME,nvidia
|
|
|
|
env = XDG_SESSION_TYPE,wayland
|
|
|
|
env = GBM_BACKEND,nvidia-drm
|
|
|
|
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
|
|
|
env = WLR_NO_HARDWARE_CURSORS,1
|
|
|
|
'')
|
|
|
|
+ (concatStringsSep "\n" (map (x: "monitor=${x}") monitors))
|
2024-06-12 10:13:43 -04:00
|
|
|
+ "\n"
|
2024-02-10 21:27:29 -05:00
|
|
|
+
|
2024-06-09 22:49:30 -04:00
|
|
|
# hyprlang
|
2024-02-10 21:27:29 -05:00
|
|
|
''
|
|
|
|
misc {
|
|
|
|
${mkHyprBlock misc}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Devices
|
|
|
|
${mkHyprBlock devices}
|
|
|
|
|
|
|
|
input {
|
|
|
|
${mkHyprBlock inputs}
|
|
|
|
}
|
|
|
|
|
|
|
|
''
|
|
|
|
+
|
2024-06-09 22:49:30 -04:00
|
|
|
# hyprlang
|
2024-02-10 21:27:29 -05:00
|
|
|
''
|
2024-06-09 22:49:30 -04:00
|
|
|
#
|
2024-02-10 21:27:29 -05:00
|
|
|
env = XCURSOR_SIZE,24
|
|
|
|
exec-once = hyprctl setcursor Dracula-cursors 24
|
|
|
|
|
|
|
|
general {
|
|
|
|
border_size = 0
|
|
|
|
}
|
|
|
|
|
|
|
|
decoration {
|
|
|
|
blur {
|
|
|
|
enabled = false
|
|
|
|
}
|
|
|
|
drop_shadow = false
|
|
|
|
}
|
|
|
|
|
|
|
|
exec-once = ${setupMonitors}
|
2024-03-24 13:54:33 -04:00
|
|
|
exec-once = astal -b greeter &> /tmp/astal.log; hyprctl dispatch exit
|
2024-02-10 21:27:29 -05:00
|
|
|
''
|
|
|
|
);
|
|
|
|
}
|