diff options
Diffstat (limited to 'modules/user/aszlig/services')
-rw-r--r-- | modules/user/aszlig/services/vlock/default.nix | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/modules/user/aszlig/services/vlock/default.nix b/modules/user/aszlig/services/vlock/default.nix index 5eb5e83d..b7bb051b 100644 --- a/modules/user/aszlig/services/vlock/default.nix +++ b/modules/user/aszlig/services/vlock/default.nix @@ -30,26 +30,28 @@ in { enable = lib.mkEnableOption "console lock"; }; - config.systemd.sockets.vlock = { - description = "Console Lock Socket"; - wantedBy = [ "sockets.target" ]; - socketConfig.ListenStream = "/run/console-lock.sock"; - socketConfig.Accept = true; - }; - - config.systemd.services."vlock@" = lib.mkIf cfg.enable { - description = "Lock All Consoles"; - serviceConfig.Type = "oneshot"; - - #environment.USER = "%i"; XXX - environment.USER = "aszlig"; - - script = '' - retval=0 - oldvt="$("${pkgs.kbd}/bin/fgconsole")" - "${vlock}/bin/vlock" -asn || retval=$? - if [ $retval -ne 0 ]; then "${pkgs.kbd}/bin/chvt" "$oldvt"; fi - exit $retval - ''; + config = lib.mkIf cfg.enable { + systemd.sockets.vlock = { + description = "Console Lock Socket"; + wantedBy = [ "sockets.target" ]; + socketConfig.ListenStream = "/run/console-lock.sock"; + socketConfig.Accept = true; + }; + + config.systemd.services."vlock@" = { + description = "Lock All Consoles"; + serviceConfig.Type = "oneshot"; + + #environment.USER = "%i"; XXX + environment.USER = "aszlig"; + + script = '' + retval=0 + oldvt="$("${pkgs.kbd}/bin/fgconsole")" + "${vlock}/bin/vlock" -asn || retval=$? + if [ $retval -ne 0 ]; then "${pkgs.kbd}/bin/chvt" "$oldvt"; fi + exit $retval + ''; + }; }; } |