diff options
Diffstat (limited to 'modules/vlock')
-rw-r--r-- | modules/vlock/default.nix | 51 | ||||
-rw-r--r-- | modules/vlock/message.cat | 18 | ||||
-rw-r--r-- | modules/vlock/message.colmap | 18 |
3 files changed, 0 insertions, 87 deletions
diff --git a/modules/vlock/default.nix b/modules/vlock/default.nix deleted file mode 100644 index 11e9a475..00000000 --- a/modules/vlock/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs, config, lib, ... }: - -let - messageFile = pkgs.runCommand "message.cat" {} '' - echo -en '\e[H\e[2J\e[?25l' > "$out" - "${pkgs.aacolorize}/bin/aacolorize" \ - "${./message.cat}" "${./message.colmap}" \ - >> "$out" - ''; - - esc = "\\\\033"; - unlockCSI = "${esc}[16;39H${esc}[?25h${esc}[K"; - - vlock = lib.overrideDerivation pkgs.vlock (o: { - postPatch = (o.postPatch or "") + '' - echo -n '"' > src/message.h - sed -e ':nl;N;$!bnl;s/[\\"]/\\&/g;s/\n/\\n/g' "${messageFile}" \ - >> src/message.h - sed -i -e '$s/$/"/' src/message.h - sed -i -e 's!getenv("VLOCK_MESSAGE")!\n#include "message.h"\n!' \ - src/vlock-main.c - sed -i -re 's/(fprintf[^"]*")(.*user)/\1${unlockCSI}\2/' \ - src/auth-pam.c - ''; - }); -in { - options.vuizvui.vlock.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 config.vuizvui.vlock.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 - ''; - }; -} diff --git a/modules/vlock/message.cat b/modules/vlock/message.cat deleted file mode 100644 index f079e829..00000000 --- a/modules/vlock/message.cat +++ /dev/null @@ -1,18 +0,0 @@ - - . - | - -_ | . .-. .-. .. ,.--., ,===. - `-_ | | '||\.||' `' , , || || ;___ - -_ >:_ | _- ||`\|| || `\/' || || ; - `-_ _-' `-_ | _-' .' `| ;' /'`\ ``=='' ,===' - >:' `:' - _-' | | _- .. .. .. - -' | | _-' || || || - .|. _:< || ,---. .---. ||,-. .--. .--|| - _-' | `-_ _-' `-_ || ||"|| ||''' |.,'' |"/' |,";| - -' | `:< `- ||_ ||_|| ||__ |,\\. ||__ ||_,| - | | `-_ `--'`---' `---' '' `' `---' `---' - ' | `- - | press ENTER to unlock - ` - diff --git a/modules/vlock/message.colmap b/modules/vlock/message.colmap deleted file mode 100644 index d7e42fb6..00000000 --- a/modules/vlock/message.colmap +++ /dev/null @@ -1,18 +0,0 @@ - - c - c - cc c b WWW WWW WW BccccB cBBBc - ccc c b WWWWWWWW WW W W Bc cB cccc - bb ccc b bb WWWWWW WW WWWW Bc cB c - bbb bbb ccc b bbb WW WW WW WWWW BcBBcB cBBBc - bbb cbb - bbb c b cc rr rr rr - bb c b ccc rr rr rr - ccb ccc rr rrrrr rrrrr rrrrr rrrr rrrrr - ccc c bbb ccc ccc rr rrRrr rrRRR rrrrr rRrr rrRrr - cc c bbb cc rrr rrrrr rrrr rrrrr rrrr rrrrr - c b bbb rrrrrrrrr rrrrr rr rr rrrrr rrrrr - c b bb - b ppppp PPPPP pp pppppp - b - |