From 5ba54fb4a918cc52b3ed1ee10219f7b3ed3c0cd2 Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Sat, 4 May 2024 12:14:04 +0200 Subject: [PATCH] feat: make sure xss-lock starts only with xorg wm sessions --- nixos/hosts/laptop-iapetus/default.nix | 25 ++++++------------------- nixos/hosts/laptop-phobos/default.nix | 4 ++++ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/nixos/hosts/laptop-iapetus/default.nix b/nixos/hosts/laptop-iapetus/default.nix index a5a05cd..00f1e74 100644 --- a/nixos/hosts/laptop-iapetus/default.nix +++ b/nixos/hosts/laptop-iapetus/default.nix @@ -1,22 +1,4 @@ -# -# Specific system configuration settings for desktop -# -# flake.nix -# ├─ ./hosts -# │ └─ ./laptop -# │ ├─ default.nix * -# │ └─ hardware-configuration.nix -# └─ ./modules -# ├─ ./desktop -# │ ├─ ./bspwm -# │ │ └─ default.nix -# │ └─ ./virtualisation -# │ └─ docker.nix -# └─ ./hardware -# └─ default.nix -# - -{ pkgs, ... }: +{ lib, pkgs, ... }: { imports = [ @@ -76,6 +58,11 @@ }; }; + systemd.user.services.xss-lock = { + partOf = lib.mkForce [ "xorg-wm-session.target" ]; + wantedBy = lib.mkForce [ "xorg-wm-session.target" ]; + }; + services = { tlp.enable = true; # TLP and auto-cpufreq for power management logind.lidSwitch = "lock"; # lock on lid close diff --git a/nixos/hosts/laptop-phobos/default.nix b/nixos/hosts/laptop-phobos/default.nix index 08d5053..b3e4b12 100644 --- a/nixos/hosts/laptop-phobos/default.nix +++ b/nixos/hosts/laptop-phobos/default.nix @@ -92,6 +92,10 @@ }; }; + systemd.user.services.xss-lock = { + partOf = lib.mkForce [ "xorg-wm-session.target" ]; + wantedBy = lib.mkForce [ "xorg-wm-session.target" ]; + }; services = { logind.lidSwitch = "suspend"; # suspend on lid close libinput = { -- 2.48.1