🚀 improve hyprland experience

This commit is contained in:
Moritz Böhme 2022-11-26 16:02:02 +01:00
parent df54824957
commit 1b536e52b5
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
9 changed files with 263 additions and 182 deletions

View file

@ -3,7 +3,7 @@
, pkgs
, inputs
, ...
}:
} @ args:
with lib;
let
@ -22,6 +22,7 @@ in
config = mkIf cfg.enable {
home-manager.users.moritz = {
imports = [ inputs.hyprland.homeManagerModules.default ];
programs.waybar = {
enable = true;
package = pkgs.waybar-hyprland;
@ -34,6 +35,7 @@ in
output = [
"eDP-1"
"HDMI-A-1"
"HDMI-A-2"
];
modules-left = [ "wlr/workspaces" ];
modules-center = [ "hyprland/window" ];
@ -46,23 +48,91 @@ in
};
};
};
wayland.windowManager.hyprland = {
enable = true;
package = hyprland;
extraConfig = builtins.readFile ./hyprland.conf;
extraConfig = import ./config.nix args;
};
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
{
event = "lock";
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
];
timeouts = [
{
timeout = 300;
command = "${hyprland}/bin/hyprctl dispatch dpms off";
resumeCommand = "${hyprland}/bin/hyprctl dispatch dpms on";
}
{
timeout = 310;
command = "${pkgs.systemd}/bin/loginctl lock-session";
}
];
};
# start swayidle as part of hyprland, not sway
systemd.user.services.swayidle.Install.WantedBy = lib.mkForce [ "hyprland-session.target" ];
};
users.users.moritz.packages = with pkgs; [
swayidle
swaylock-effects
pamixer
playerctl
brightnessctl
];
security.pam.services.swaylock = { };
programs.hyprland = {
enable = true;
package = null;
};
environment.sessionVariables =
{
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
QT_QPA_PLATFORM = "wayland;xcb";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_QPA_PLATFORMTHEME = "qt5ct";
_JAVA_AWT_WM_NONEREPARENTING = "1";
} //
(if cfg.nvidiaSupport then
{
LIBVA_DRIVER_NAME = "nvidia";
XDG_SESSION_TYPE = "wayland";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
WLR_NO_HARDWARE_CURSORS = "1";
__GL_VRR_ALLOWED = "0";
} else { });
services.xserver = {
enable = true;
displayManager = {
gdm.enable = true;
autoLogin = {
enable = true;
user = "moritz";
};
defaultSession = "hyprland";
sessionPackages = [ hyprland ];
};
};
xdg.portal = {
enable = true;
wlr.enable = true;