summaryrefslogtreecommitdiffstats
path: root/tv
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-02-11 14:06:45 +0100
committermakefu <github@syntax-fehler.de>2021-02-11 14:06:45 +0100
commit540e13721d85dcf100bf3529414d96cd8e28a446 (patch)
tree7db6b3955f8f06af83434027e4825f8b160ba9d4 /tv
parent38bddfd404b4418b4e820dfbd312145fc6abca68 (diff)
parentd0e7bc46b4cdb15f7505aa069ac29588b02ddf92 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'tv')
-rw-r--r--tv/2configs/hw/AO753.nix4
-rw-r--r--tv/2configs/ppp.nix6
-rw-r--r--tv/2configs/repo-sync/wiki.nix41
-rw-r--r--tv/2configs/vim.nix5
-rw-r--r--tv/5pkgs/default.nix8
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/Paths.hs3
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/main.hs3
-rw-r--r--tv/5pkgs/override/default.nix7
-rw-r--r--tv/5pkgs/override/fzf.complete1.patch55
-rw-r--r--tv/5pkgs/override/rxvt_unicode.nix8
-rw-r--r--tv/5pkgs/simple/xdpytools/default.nix31
-rwxr-xr-xtv/5pkgs/simple/xdpytools/src/xdpychvt11
-rwxr-xr-xtv/5pkgs/simple/xdpytools/src/xdpysel49
13 files changed, 221 insertions, 10 deletions
diff --git a/tv/2configs/hw/AO753.nix b/tv/2configs/hw/AO753.nix
index d5b755cef..a91a5e518 100644
--- a/tv/2configs/hw/AO753.nix
+++ b/tv/2configs/hw/AO753.nix
@@ -21,6 +21,10 @@ with import <stockholm/lib>;
"wl"
];
+ # broadcom_sta is marked as broken for 5.9+
+ # pkgs.linuxPackages_latest ist 5.9
+ boot.kernelPackages = pkgs.linuxPackages_5_8;
+
boot.extraModulePackages = [
config.boot.kernelPackages.broadcom_sta
];
diff --git a/tv/2configs/ppp.nix b/tv/2configs/ppp.nix
index ff61f943f..c801401b2 100644
--- a/tv/2configs/ppp.nix
+++ b/tv/2configs/ppp.nix
@@ -8,8 +8,10 @@
in {
assertions = [
{
- assertion = config.networking.resolvconf.enable;
- message = "ppp configuration needs resolvconf";
+ assertion =
+ config.networking.resolvconf.enable ||
+ config.networking.useNetworkd;
+ message = "ppp configuration needs resolvconf or networkd";
}
];
environment.etc."ppp/ip-up".source = pkgs.writeDash "ppp.ip-up" ''
diff --git a/tv/2configs/repo-sync/wiki.nix b/tv/2configs/repo-sync/wiki.nix
new file mode 100644
index 000000000..913439906
--- /dev/null
+++ b/tv/2configs/repo-sync/wiki.nix
@@ -0,0 +1,41 @@
+{ config, pkgs, ... }: let
+ lib = import <stockholm/lib>;
+in {
+ krebs.repo-sync.enable = true;
+ krebs.repo-sync.repos.wiki.branches.hotdog = {
+ origin.url = "http://cgit.hotdog.r/wiki";
+ mirror.url = "git@${config.krebs.build.host.name}.r:wiki";
+ };
+ krebs.git.repos.wiki = {
+ public = true;
+ name = "wiki";
+ cgit.desc = toString [
+ "mirror of"
+ config.krebs.repo-sync.repos.wiki.branches.hotdog.origin.url
+ ];
+ cgit.section = "7. mirrors";
+ hooks.post-receive = /* sh */ ''
+ ${pkgs.git-hooks.irc-announce {
+ channel = "#xxx";
+ nick = config.krebs.build.host.name;
+ server = "irc.r";
+ }}
+ ${pkgs.cgit-clear-cache.override {
+ inherit (config.krebs.git.cgit.settings) cache-root;
+ }}/bin/cgit-clear-cache
+ '';
+ };
+ krebs.git.rules = lib.singleton {
+ user = lib.singleton config.krebs.users.repo-sync;
+ repo = lib.singleton config.krebs.git.repos.wiki;
+ perm = lib.git.push "refs/*" [
+ lib.git.create
+ lib.git.delete
+ lib.git.merge
+ lib.git.non-fast-forward
+ ];
+ };
+ krebs.users.${config.krebs.repo-sync.user.name}.pubkey = {
+ ni = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINK9U0Ob9/O0kxg3trhZY/vDnbqfN+R5cASGiClRr4IM";
+ }.${config.krebs.build.host.name};
+}
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix
index f8d599f7e..c0125ecfa 100644
--- a/tv/2configs/vim.nix
+++ b/tv/2configs/vim.nix
@@ -72,7 +72,7 @@ let {
set mouse=a
set noruler
set pastetoggle=<INS>
- set runtimepath=$VIMRUNTIME,${extra-runtimepath}
+ set runtimepath=${extra-runtimepath},$VIMRUNTIME
set shortmess+=I
set showcmd
set showmatch
@@ -133,7 +133,8 @@ let {
vnoremap u <nop>
" fzf
- nnoremap <esc>q :Files<cr>
+ nnoremap <esc>q :Buffers<cr>
+ nnoremap <esc>f :Files<cr>
nnoremap <esc>w :Rg<cr>
" edit alternate buffer
diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix
index fd3d2f32a..cae5da112 100644
--- a/tv/5pkgs/default.nix
+++ b/tv/5pkgs/default.nix
@@ -13,13 +13,17 @@ foldl' mergeAttrs {}
//
{
- # TODO use XDG_RUNTIME_DIR?
cr = self.writeDashBin "cr" ''
set -efu
+ if test -n "''${XDG_RUNTIME_DIR-}"; then
+ cache_dir=$XDG_RUNTIME_DIR/chromium-disk-cache
+ else
+ cache_dir=/tmp/chromium-disk-cache_$LOGNAME
+ fi
export LC_TIME=de_DE.utf8
exec ${self.chromium}/bin/chromium \
--ssl-version-min=tls1 \
- --disk-cache-dir=/tmp/chromium-disk-cache_"$LOGNAME" \
+ --disk-cache-dir="$cache_dir" \
--disk-cache-size=50000000 \
"$@"
'';
diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
index 6b7235530..b2ad01ae7 100644
--- a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
+++ b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
@@ -29,3 +29,6 @@ urxvtc = findExecutable "urxvtc"
xcalib :: FilePath
xcalib = findExecutable "xcalib"
+
+xdpychvt :: FilePath
+xdpychvt = findExecutable "xdpychvt"
diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs
index 50b03d81c..e5a4473fe 100644
--- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs
+++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs
@@ -190,6 +190,9 @@ myKeys conf = Map.fromList $
, ((_4, xK_Prior), forkFile Paths.xcalib ["-invert", "-alter"] Nothing)
, ((0, xK_Print), forkFile Paths.flameshot [] Nothing)
+
+ , ((_C, xF86XK_Forward), forkFile Paths.xdpychvt ["next"] Nothing)
+ , ((_C, xF86XK_Back), forkFile Paths.xdpychvt ["prev"] Nothing)
]
where
_4 = mod4Mask
diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix
index d18d66506..cf99e0377 100644
--- a/tv/5pkgs/override/default.nix
+++ b/tv/5pkgs/override/default.nix
@@ -1,5 +1,12 @@
with import <stockholm/lib>;
self: super: {
+ fzf = super.fzf.overrideAttrs (old: {
+ # XXX cannot use `patches` because fzf has a custom patchPhase
+ patchPhase = ''
+ patch -Np1 < ${./fzf.complete1.patch}
+ ${old.patchPhase}
+ '';
+ });
input-fonts = super.input-fonts.overrideAttrs (old: rec {
src = self.fetchurl {
url = "http://xu.r/~tv/mirrors/input-fonts/Input-Font-2.zip";
diff --git a/tv/5pkgs/override/fzf.complete1.patch b/tv/5pkgs/override/fzf.complete1.patch
new file mode 100644
index 000000000..4b2126a2c
--- /dev/null
+++ b/tv/5pkgs/override/fzf.complete1.patch
@@ -0,0 +1,55 @@
+diff --git a/src/core.go b/src/core.go
+index a18c3a1..a3d92a4 100644
+--- a/src/core.go
++++ b/src/core.go
+@@ -331,6 +331,13 @@ func Run(opts *Options, version string, revision string) {
+ }
+ }
+ terminal.UpdateList(val, clearSelection())
++ if (opts.Complete1) {
++ count := val.Length()
++ if count == 1 {
++ opts.Printer(val.Get(0).item.AsString(opts.Ansi))
++ terminal.reqBox.Set(reqClose, nil)
++ }
++ }
+ }
+ }
+ }
+diff --git a/src/options.go b/src/options.go
+index a55dc34..7f121cd 100644
+--- a/src/options.go
++++ b/src/options.go
+@@ -92,6 +92,7 @@ const usage = `usage: fzf [options]
+ -1, --select-1 Automatically select the only match
+ -0, --exit-0 Exit immediately when there's no match
+ -f, --filter=STR Filter mode. Do not start interactive finder.
++ --complete-1 Exit interactive finder when there's exactly one match
+ --print-query Print query as the first line
+ --expect=KEYS Comma-separated list of keys to complete fzf
+ --read0 Read input delimited by ASCII NUL characters
+@@ -208,6 +209,7 @@ type Options struct {
+ Query string
+ Select1 bool
+ Exit0 bool
++ Complete1 bool
+ Filter *string
+ ToggleSort bool
+ Expect map[tui.Event]string
+@@ -269,6 +271,7 @@ func defaultOptions() *Options {
+ Query: "",
+ Select1: false,
+ Exit0: false,
++ Complete1: false,
+ Filter: nil,
+ ToggleSort: false,
+ Expect: make(map[tui.Event]string),
+@@ -1311,6 +1314,8 @@ func parseOptions(opts *Options, allArgs []string) {
+ opts.Exit0 = true
+ case "+0", "--no-exit-0":
+ opts.Exit0 = false
++ case "--complete-1":
++ opts.Complete1 = true
+ case "--read0":
+ opts.ReadZero = true
+ case "--no-read0":
diff --git a/tv/5pkgs/override/rxvt_unicode.nix b/tv/5pkgs/override/rxvt_unicode.nix
index 4d9c3abc3..53aaf0658 100644
--- a/tv/5pkgs/override/rxvt_unicode.nix
+++ b/tv/5pkgs/override/rxvt_unicode.nix
@@ -3,15 +3,15 @@ rxvt_unicode.overrideAttrs (old: {
patches = old.patches ++ [
(fetchurl {
name = "rxvt-unicode.cancel-running-selection-request.patch";
- url = https://cgit.krebsco.de/rxvt-unicode/patch/?id=15f3f94;
- sha256 = "12vldwsds27c9l15ffc6svk9mj17jhypcz736pvpmpqbsymlkz2p";
+ url = "https://cgit.krebsco.de/rxvt-unicode/rawdiff/?id=15f3f94&id2=15f3f94^";
+ sha256 = "1c7jq8phl85d2f581b4mc6fkmr2nv9n44qjjs4idi51sd2hs7sxw";
})
# Fix segfault when calling editor-input from XMonad.
(fetchurl {
name = "rxvt-unicode.no-perl_destruct.patch";
- url = "https://cgit.krebsco.de/rxvt-unicode/patch/?id=d63f96a";
- sha256 = "0i8nqrqgprv7cygflkrdp5zx75dv9bv84vrr2yc3vnfpqxamc43n";
+ url = "https://cgit.krebsco.de/rxvt-unicode/rawdiff/?id=d63f96a&id2=d63f96a^";
+ sha256 = "0fq9w4fq8mw05jk9bblzlh1x51m2cmk62xbc4c1mbiqagjmsi9f8";
})
];
})
diff --git a/tv/5pkgs/simple/xdpytools/default.nix b/tv/5pkgs/simple/xdpytools/default.nix
new file mode 100644
index 000000000..7d1ee071e
--- /dev/null
+++ b/tv/5pkgs/simple/xdpytools/default.nix
@@ -0,0 +1,31 @@
+{ lib, pkgs }:
+
+let
+ install = name: { path }: /* sh */ ''
+ (
+ mkdir -p $out/bin
+ touch $out/bin/${name}
+ chmod +x $out/bin/${name}
+ exec >$out/bin/${name}
+
+ echo '#! ${pkgs.dash}/bin/dash'
+ echo export PATH=${lib.makeBinPath path}
+ sed 1d ${./src + "/${name}"}
+ )
+ '';
+in
+
+pkgs.runCommand "xdpytools" {}
+ (toString
+ (lib.mapAttrsToList install {
+ xdpychvt.path = [
+ "$out"
+ "/run/wrappers/'$LOGNAME'"
+ "/run/wrappers"
+ ];
+ xdpysel.path = [
+ "$out"
+ pkgs.findutils
+ pkgs.jq
+ ];
+ }))
diff --git a/tv/5pkgs/simple/xdpytools/src/xdpychvt b/tv/5pkgs/simple/xdpytools/src/xdpychvt
new file mode 100755
index 000000000..84c1907b9
--- /dev/null
+++ b/tv/5pkgs/simple/xdpytools/src/xdpychvt
@@ -0,0 +1,11 @@
+#! /bin/sh
+# usage: xdpychvt {prev,next}
+# Changes to the VT based on the selected X display.
+#
+# This allows switching between X servers when display names and VT numbers
+# correlate. A more sophisticated tool would try to determine the correct VT
+# by e.g. looking at /proc, but this might not possible when e.g. using
+# security.hideProcessInformation.
+#
+
+chvt "$(xdpysel "$1")"
diff --git a/tv/5pkgs/simple/xdpytools/src/xdpysel b/tv/5pkgs/simple/xdpytools/src/xdpysel
new file mode 100755
index 000000000..e08015576
--- /dev/null
+++ b/tv/5pkgs/simple/xdpytools/src/xdpysel
@@ -0,0 +1,49 @@
+#! /bin/sh
+# usage: xdpysel {prev,next}
+# Print the number of the selected X display.
+
+find /tmp/.X11-unix -mindepth 1 -maxdepth 1 |
+jq -Rrs --arg command "$1" '
+ (
+ split("\n") |
+ map(
+ select(.!="") |
+ match("^.*/X([0-9]+)$").captures[0].string |
+ tonumber
+ )
+ )
+ as $all_displays |
+
+ (
+ env.DISPLAY |
+ match("^:([0-9]+)(?:[.][0-9]+)?$").captures[0].string |
+ tonumber
+ )
+ as $current_display |
+
+ ($all_displays | length) as $all_displays_count |
+
+ ($all_displays|index($current_display))
+ as $current_index |
+
+ (($current_index + 1) % $all_displays_count)
+ as $next_index |
+
+ (($all_displays_count + $current_index - 1) % $all_displays_count)
+ as $prev_index |
+
+ $all_displays[$prev_index] as $prev_display |
+ $all_displays[$next_index] as $next_display |
+
+ {
+ prev: $prev_display,
+ next: $next_display,
+ }[$command]
+ as $result |
+
+ if $result | type == "number" then
+ $result
+ else
+ "xdpysel: bad argument: \($command)\n" | halt_error(-1)
+ end
+'