From 4c775478bc7fa9d2bbf80c31ce0880fe1b2cc06b Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 10 Jun 2024 18:52:38 +0200 Subject: [PATCH] Add missing device role check for physlock --- system/roles/workstation/programs/physlock.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/system/roles/workstation/programs/physlock.nix b/system/roles/workstation/programs/physlock.nix index b692160..ef08482 100644 --- a/system/roles/workstation/programs/physlock.nix +++ b/system/roles/workstation/programs/physlock.nix @@ -1,8 +1,14 @@ -{ - # Screen locker which works across all virtual terminals - # Use `systemctl start physlock` to securely lock the screen - services.physlock = { - enable = true; - lockMessage = "System is locked..."; +{ lib, config, ...}: let + inherit (lib) mkIf; + deviceType = config.myOptions.device.roles.type; + acceptedTypes = ["laptop" "desktop"]; +in { + config = mkIf (builtins.elem deviceType acceptedTypes) { + # Screen locker which works across all virtual terminals + # Use `systemctl start physlock` to securely lock the screen + services.physlock = { + enable = true; + lockMessage = "System is locked..."; + }; }; }