我锁屏软件用的 betterlockscreen
https://github.com/betterlockscreen/betterlockscreen
作者给的教程不能在 nixos 直接使用(根本没有 /usr/lib/systemd/system/ 这个目录
参考他的 betterlockscreen@.service
[Unit]
Description = Lock screen when going to sleep/suspend
Before=sleep.target
Before=suspend.target
[Service]
User=%I
Type=simple
Environment=DISPLAY=:0
ExecStart=/usr/local/bin/betterlockscreen --lock
TimeoutSec=infinity
ExecStartPost=/usr/bin/sleep 1
[Install]
WantedBy=sleep.target
WantedBy=suspend.target
nix 的资料太少了
{
config, lib, pkgs, ... }:
{
systemd.