From e7116bc68ea2e15d67f3ece21ff3bccafc5b58b4 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 13 Jan 2021 04:54:29 +0100 Subject: tv pinentry-urxvt: init --- tv/5pkgs/simple/pinentry-urxvt/default.nix | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tv/5pkgs/simple/pinentry-urxvt/default.nix (limited to 'tv') diff --git a/tv/5pkgs/simple/pinentry-urxvt/default.nix b/tv/5pkgs/simple/pinentry-urxvt/default.nix new file mode 100644 index 000000000..65b76c077 --- /dev/null +++ b/tv/5pkgs/simple/pinentry-urxvt/default.nix @@ -0,0 +1,56 @@ +{ pkgs, ... }@args: + +let + lib = import ; + + # config cannot be declared in the input attribute set because that would + # cause callPackage to inject the wrong config. Instead, get it from ... + # via args. + config = args.config or {}; + + cfg = eval.config; + + eval = lib.evalModules { + modules = lib.singleton { + _file = toString ./default.nix; + imports = lib.singleton config; + options = { + appName = lib.mkOption { + default = "pinentry-urxvt"; + type = lib.types.str; + }; + display = lib.mkOption { + default = ":0"; + type = lib.types.str; + }; + }; + }; + }; + + +in + + pkgs.write "pinentry-urxvt" { + "/bin/pinentry".link = pkgs.writeDash "pinentry-urxvt-wrapper" '' + set -efu + exec 3<&0 4>&1 5>&2 + export DISPLAY=${lib.shell.escape cfg.display} + exec ${pkgs.rxvt_unicode}/bin/urxvt \ + -name ${lib.shell.escape cfg.appName} \ + -e ${pkgs.writeDash "pinentry-urxvt-tty" '' + set -efu + exec 2>&5 + TTY=$(${pkgs.coreutils}/bin/tty) + while read -r line <&3; do + case $line in + 'OPTION ttyname='*) + echo "OPTION ttyname=$TTY" + ;; + *) + echo "$line" + esac + done | ${pkgs.pinentry.tty}/bin/pinentry-tty "$@" >&4 + ''} \ + "$@" + ''; + } -- cgit v1.2.3 From d59ef4a45c644e8882acf408991f3fcb3f759ebd Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 13 Jan 2021 04:56:43 +0100 Subject: tv xmonad: center float all pinentry windows --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tv') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index b8ddd27e8..50b03d81c 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -8,6 +8,7 @@ import System.Exit (exitFailure) import Control.Exception import Control.Monad.Extra (whenJustM) +import qualified Data.List import Graphics.X11.ExtraTypes.XF86 import Text.Read (readEither) import XMonad @@ -59,6 +60,11 @@ main = getArgs >>= \case args -> hPutStrLn stderr ("bad arguments: " <> show args) >> exitFailure +queryPrefix :: Query String -> String -> Query Bool +queryPrefix query prefix = + fmap (Data.List.isPrefixOf prefix) query + + mainNoArgs :: IO () mainNoArgs = do workspaces0 <- getWorkspaces0 @@ -82,7 +88,7 @@ mainNoArgs = do , manageHook = composeAll [ appName =? "fzmenu-urxvt" --> doCenterFloat - , appName =? "pinentry" --> doCenterFloat + , appName `queryPrefix` "pinentry" --> doCenterFloat , title =? "Upload to Imgur" --> doRectFloat (W.RationalRect 0 0 (1 % 8) (1 % 8)) , placeHook (smart (1,0)) -- cgit v1.2.3 From 0260651324ae28b58b9d565f03d9f9c81a50219f Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 14 Jan 2021 16:41:47 +0100 Subject: tv mu: fsck.repair=yes --- tv/1systems/mu/config.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'tv') diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index d5169281d..c80a9ba1d 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -17,6 +17,7 @@ with import ; boot.initrd.luks.devices.muca.device = "/dev/sda2"; boot.initrd.availableKernelModules = [ "ahci" ]; boot.kernelModules = [ "fbcon" "kvm-intel" ]; + boot.kernelParams = [ "fsck.repair=yes" ]; boot.extraModulePackages = [ ]; fileSystems = { -- cgit v1.2.3 From 4319cfd283f58b482af261c22f8293384fb2d663 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 14 Jan 2021 16:42:22 +0100 Subject: tv mu: lightdm -> autoLogin --- tv/1systems/mu/config.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tv') diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index c80a9ba1d..8fd6ee45b 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -110,9 +110,8 @@ with import ; services.xserver.desktopManager.plasma5.enable = true; - services.xserver.displayManager.lightdm.autoLogin.enable = true; - services.xserver.displayManager.lightdm.autoLogin.user = "vv"; - services.xserver.displayManager.lightdm.enable = true; + services.xserver.displayManager.autoLogin.enable = true; + services.xserver.displayManager.autoLogin.user = "vv"; users.users.vv = { inherit (config.krebs.users.vv) home uid; -- cgit v1.2.3 From a68e8e39f6c844f921176875ab79e69b4c66871a Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 15 Jan 2021 23:30:37 +0100 Subject: tv slock service: conflicts picom service When picom is running, slock will show the screenshot of the locked screen after DPMS changes state to `on'. https://bbs.archlinux.org/viewtopic.php?id=256547 seems related, but the suggested fix (adding `no-fading-openclose = true;` to picom's config) didn't help. With this commit, the picom service gets "suspended" while the slock service is running. --- tv/3modules/slock.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tv') diff --git a/tv/3modules/slock.nix b/tv/3modules/slock.nix index 53f7f1f62..926adc8e0 100644 --- a/tv/3modules/slock.nix +++ b/tv/3modules/slock.nix @@ -28,6 +28,9 @@ in { }); ''; systemd.services."slock-${cfg.user.name}@" = { + conflicts = [ + "picom@%i.target" + ]; environment = { DISPLAY = ":%I"; LD_PRELOAD = pkgs.runCommandCC "slock-${cfg.user.name}.so" { @@ -61,6 +64,8 @@ in { restartIfChanged = false; serviceConfig = { ExecStart = "${pkgs.slock}/bin/slock"; + ExecStopPost = + "+${pkgs.systemd}/bin/systemctl start xsession@%i.target"; OOMScoreAdjust = -1000; Restart = "on-failure"; RestartSec = "100ms"; -- cgit v1.2.3