From f54e3593a040565d3d4d1be0ca9aea2712497670 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Sun, 1 Oct 2023 14:19:43 -0500 Subject: [PATCH] enable systemd fixes --- home/features/desktop/hyprland/default.nix | 2 +- .../desktop/hyprland/systemd-fixes.nix | 40 ++++++++----------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/home/features/desktop/hyprland/default.nix b/home/features/desktop/hyprland/default.nix index c4a51de..e065aa1 100644 --- a/home/features/desktop/hyprland/default.nix +++ b/home/features/desktop/hyprland/default.nix @@ -2,7 +2,7 @@ imports = [ ./binds.nix - # ./systemd-fixes.nix + ./systemd-fixes.nix ./tty-init.nix ../wayland-wm ]; diff --git a/home/features/desktop/hyprland/systemd-fixes.nix b/home/features/desktop/hyprland/systemd-fixes.nix index 3d31e09..51f8ba9 100644 --- a/home/features/desktop/hyprland/systemd-fixes.nix +++ b/home/features/desktop/hyprland/systemd-fixes.nix @@ -1,27 +1,21 @@ -{ lib, config, ... }: -let - cfg = config.wayland.windowManager.hyprland; -in -{ - config = lib.mkIf (cfg.enable && cfg.systemdIntegration) { - # stolen from https://github.com/alebastr/sway-systemd/commit/0fdb2c4b10beb6079acd6073c5b3014bd58d3b74 - systemd.user.targets.hyprland-session-shutdown = { - Unit = { - Description = "Shutdown running Hyprland session"; - DefaultDependencies = "no"; - StopWhenUnneeded = "true"; +{ lib, config, ... }: { + # stolen from https://github.com/alebastr/sway-systemd/commit/0fdb2c4b10beb6079acd6073c5b3014bd58d3b74 + systemd.user.targets.hyprland-session-shutdown = { + Unit = { + Description = "Shutdown running Hyprland session"; + DefaultDependencies = "no"; + StopWhenUnneeded = "true"; - Conflicts = [ - "graphical-session.target" - "graphical-session-pre.target" - "hyprland-session.target" - ]; - After = [ - "graphical-session.target" - "graphical-session-pre.target" - "hyprland-session.target" - ]; - }; + Conflicts = [ + "graphical-session.target" + "graphical-session-pre.target" + "hyprland-session.target" + ]; + After = [ + "graphical-session.target" + "graphical-session-pre.target" + "hyprland-session.target" + ]; }; wayland.windowManager.hyprland.settings.bind = lib.mkAfter [ "SUPERSHIFT,e,exec,systemctl --user start hyprland-session-shutdown.target; hyprctl dispatch exit"