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 a5a05cd0684e31659958c74aec8200d526b2c550..00f1e747c9b459166d77ab6f4918f6ccb0a6d181 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 08d50536f25b36c3095f4c56e7de5d569228b556..b3e4b125345b55ca419aec3299d4b1e492323d78 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 = {