| lockMessage = "This computer has been locked, please enter your password to continue"; |
| killUnconfinedConfinables = true; |
| boot.initrd.availableKernelModules = [ |
| boot.initrd.luks.devices = { |
| nix.device = "/dev/disk/by-label/NIX"; |
| swap.device = "/dev/disk/by-label/SWAP"; |
| hdd.device = "/dev/disk/by-label/HDD"; |
| ${pkgs.sway}/bin/swaymsg output "*" dpms off |
| ${config.security.wrapperDir}/physlock -s -p "${lockMessage}" |
| while [ $(${pkgs.sway}/bin/swaymsg -t get_seats | ${pkgs.jq}/bin/jq "[.[] | .capabilities] | max") -eq 0 ]; do ${pkgs.coreutils}/bin/sleep 0.1; done |
| ${pkgs.sway}/bin/swaymsg output "*" dpms on |
| (lib.filter (line: line != "")) |
| (lib.concatStringsSep " && ") |
| (pkgs.writeScriptBin "lock" lockCommand) |