improve hyprland module

This commit is contained in:
Moritz Böhme 2022-12-30 19:01:31 +01:00
parent fc1084b0ca
commit 7c90839817
Signed by: moritz
GPG key ID: 970C6E89EB0547A9

View file

@ -9,9 +9,7 @@ with lib;
let let
cfg = config.my.programs.hyprland; cfg = config.my.programs.hyprland;
hyprland-default = inputs.hyprland.packages.${pkgs.system}.default; hyprland = pkgs.hyprland.override { nvidiaPatches = cfg.nvidiaSupport; };
hyprland-nvidia = hyprland-default.override { nvidiaPatches = true; };
hyprland = if cfg.nvidiaSupport then hyprland-nvidia else hyprland-default;
in in
{ {
options.my.programs.hyprland = { options.my.programs.hyprland = {
@ -26,7 +24,10 @@ in
programs.waybar = { programs.waybar = {
enable = true; enable = true;
package = pkgs.waybar-hyprland; package = pkgs.waybar-hyprland;
systemd.enable = true; systemd = {
enable = true;
target = "hyprland-session.target";
};
settings = { settings = {
mainBar = { mainBar = {
layer = "top"; layer = "top";
@ -90,15 +91,14 @@ in
wallpaper = ,${wallpaper} wallpaper = ,${wallpaper}
''; '';
in in
# setWallpaper "/home/moritz/.config/wallpapers/a_short_walk.png"; setWallpaper "/home/moritz/.config/wallpapers/a_short_walk.png";
setWallpaper "/home/moritz/.config/wallpapers/mario.gif";
onChange = "${pkgs.systemd}/bin/systemctl restart --user hyprpaper.service"; onChange = "${pkgs.systemd}/bin/systemctl restart --user hyprpaper.service";
}; };
}; };
systemd.user.services.hyprpaper = { systemd.user.services.hyprpaper = {
enable = true; enable = true;
path = [ pkgs.hyprpaper ]; path = [ pkgs.hyprpaper ];
wantedBy = [ "display-manager.service" ]; wantedBy = [ "hyprland-session.target" ];
after = [ "display-manager.service" ]; after = [ "display-manager.service" ];
script = "hyprpaper"; script = "hyprpaper";
}; };
@ -167,6 +167,7 @@ in
xdg.portal = { xdg.portal = {
enable = true; enable = true;
wlr.enable = true; wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
}; };
}; };
} }