From 0c4f3acb281be6290c55a6e96bc29fab5b5c7a11 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 11 Sep 2023 18:24:28 +0200 Subject: stockholm -> hrm --- pkgs/override/alacritty.nix | 16 ++++++++ pkgs/override/anbox.nix | 72 ++++++++++++++++++++++++++++++++++++ pkgs/override/default.nix | 11 ++++++ pkgs/override/fzf/complete1.patch | 77 +++++++++++++++++++++++++++++++++++++++ pkgs/override/fzf/default.nix | 7 ++++ pkgs/override/gitAndTools.nix | 5 +++ pkgs/override/input-fonts.nix | 13 +++++++ pkgs/override/iosevka-tv-1.nix | 20 ++++++++++ pkgs/override/iosevka-tv-2.nix | 20 ++++++++++ pkgs/override/jc.nix | 21 +++++++++++ pkgs/override/uqmi.nix | 10 +++++ 11 files changed, 272 insertions(+) create mode 100644 pkgs/override/alacritty.nix create mode 100644 pkgs/override/anbox.nix create mode 100644 pkgs/override/default.nix create mode 100644 pkgs/override/fzf/complete1.patch create mode 100644 pkgs/override/fzf/default.nix create mode 100644 pkgs/override/gitAndTools.nix create mode 100644 pkgs/override/input-fonts.nix create mode 100644 pkgs/override/iosevka-tv-1.nix create mode 100644 pkgs/override/iosevka-tv-2.nix create mode 100644 pkgs/override/jc.nix create mode 100644 pkgs/override/uqmi.nix (limited to 'pkgs/override') diff --git a/pkgs/override/alacritty.nix b/pkgs/override/alacritty.nix new file mode 100644 index 0000000..f864fff --- /dev/null +++ b/pkgs/override/alacritty.nix @@ -0,0 +1,16 @@ +self: super: + +super.alacritty.overrideAttrs (old: + if self.lib.versions.majorMinor old.version == "0.12" then + { + version = "${old.version}-tv"; + src = self.fetchFromGitHub { + owner = "4z3"; + repo = "alacritty"; + rev = "touchscreen-support-0.12"; + hash = "sha256-yDG7IeQUmJhKMJebhMDzHLb3UHGLcO1FVZnmGe5Xr9w="; + }; + } + else + builtins.trace "not overriding alacritty because unsupported version" {} +) diff --git a/pkgs/override/anbox.nix b/pkgs/override/anbox.nix new file mode 100644 index 0000000..3940617 --- /dev/null +++ b/pkgs/override/anbox.nix @@ -0,0 +1,72 @@ +self: super: + +# https://github.com/NixOS/nixpkgs/pull/125600 +super.anbox.overrideAttrs (old: + assert old.version == "unstable-2020-11-29"; + rec { + version = "unstable-2021-05-26"; + + src = self.fetchFromGitHub { + owner = old.pname; + repo = old.pname; + rev = "ad377ff25354d68b76e2b8da24a404850f8514c6"; + sha256 = "1bj07ixwbkli4ycjh41mnqdbsjz9haiwg2nhf9anbi29z1d0819w"; + fetchSubmodules = true; + }; + + postPatch = old.patchPhase; + + # patchPhase() from + # TODO patchPhase = default.patchPhase; or something + patchPhase = '' + runHook prePatch + + for i in ''${patches:-}; do + header "applying patch $i" 3 + local uncompress=cat + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac + # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.) + # shellcheck disable=SC2086 + $uncompress < "$i" 2>&1 | patch ''${patchFlags:--p1} + done + + runHook postPatch + ''; + + patches = [ + # Fixes compatibility with lxc 4 + (self.fetchpatch { + url = "https://git.alpinelinux.org/aports/plain/community/anbox/lxc4.patch?id=64243590a16aee8d4e72061886fc1b15256492c3"; + sha256 = "1da5xyzyjza1g2q9nbxb4p3njj2sf3q71vkpvmmdphia5qnb0gk5"; + }) + # Wait 10× more time when starting + # Not *strictly* needed, but helps a lot on slower hardware + (self.fetchpatch { + url = "https://git.alpinelinux.org/aports/plain/community/anbox/give-more-time-to-start.patch?id=058b56d4b332ef3379551b343bf31e0f2004321a"; + sha256 = "0iiz3c7fgfgl0dvx8sf5hv7a961xqnihwpz6j8r0ib9v8piwxh9a"; + }) + # Ensures generated desktop files work on store path change + (self.fetchpatch { + url = "https://raw.githubusercontent.com/NixOS/nixpkgs/fdf7b4be1a659ed8b96586c2fc8ff90850e25feb/pkgs/os-specific/linux/anbox/0001-NixOS-Use-anbox-from-PATH-in-desktop-files.patch"; + sha256 = "173z84g1r8h367a2dgk6945is6vxg4j1hs2hkfd3m3bbpwfw9221"; + }) + # Provide window icons + (self.fetchpatch { + url = "https://github.com/samueldr/anbox/commit/2387f4fcffc0e19e52e58fb6f8264fbe87aafe4d.patch"; + sha256 = "12lmr0kxw1n68g3abh1ak5awmpczfh75c26f53jc8qpvdvv1ywha"; + }) + ]; +}) diff --git a/pkgs/override/default.nix b/pkgs/override/default.nix new file mode 100644 index 0000000..cf64142 --- /dev/null +++ b/pkgs/override/default.nix @@ -0,0 +1,11 @@ +self: super: + +let + inherit (super) lib; + + mylib = import ../../lib/pure.nix { + inherit lib; + }; +in + +mylib.mapNixDir (path: import path self super) ./. diff --git a/pkgs/override/fzf/complete1.patch b/pkgs/override/fzf/complete1.patch new file mode 100644 index 0000000..3e3f2c4 --- /dev/null +++ b/pkgs/override/fzf/complete1.patch @@ -0,0 +1,77 @@ +commit 57cbd76c068121b685399fdb4649e7ba537983d6 +Author: tv +Date: Mon Dec 5 15:24:30 2022 +0100 + + Add --complete-1 option + +diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 +index 79e7291..3b8a753 100644 +--- a/man/man1/fzf.1 ++++ b/man/man1/fzf.1 +@@ -685,6 +685,9 @@ interactive finder and automatically select the only match + If there is no match for the initial query (\fB--query\fR), do not start + interactive finder and exit immediately + .TP ++.B "--complete-1" ++Exit interactive finder when there's exactly one match ++.TP + .BI "-f, --filter=" "STR" + Filter mode. Do not start interactive finder. When used with \fB--no-sort\fR, + fzf becomes a fuzzy-version of grep. +diff --git a/src/core.go b/src/core.go +index 2ddddc3..09afff2 100644 +--- a/src/core.go ++++ b/src/core.go +@@ -337,8 +337,14 @@ func Run(opts *Options, version string, revision string) { + } + determine(val.final) + } ++ } else { ++ if opts.Complete1 && val.Length() == 1 { ++ opts.Printer(val.Get(0).item.AsString(opts.Ansi)) ++ terminal.reqBox.Set(reqClose, nil) ++ } else { ++ terminal.UpdateList(val, clearSelection()) ++ } + } +- terminal.UpdateList(val, clearSelection()) + } + } + } +diff --git a/src/options.go b/src/options.go +index 5400311..1e38fe4 100644 +--- a/src/options.go ++++ b/src/options.go +@@ -108,6 +108,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 +@@ -274,6 +275,7 @@ type Options struct { + Query string + Select1 bool + Exit0 bool ++ Complete1 bool + Filter *string + ToggleSort bool + Expect map[tui.Event]string +@@ -342,6 +344,7 @@ func defaultOptions() *Options { + Query: "", + Select1: false, + Exit0: false, ++ Complete1: false, + Filter: nil, + ToggleSort: false, + Expect: make(map[tui.Event]string), +@@ -1546,6 +1549,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/pkgs/override/fzf/default.nix b/pkgs/override/fzf/default.nix new file mode 100644 index 0000000..2254d45 --- /dev/null +++ b/pkgs/override/fzf/default.nix @@ -0,0 +1,7 @@ +self: super: + +super.fzf.overrideAttrs (old: { + patches = old.patches or [] ++ [ + ./complete1.patch + ]; +}) diff --git a/pkgs/override/gitAndTools.nix b/pkgs/override/gitAndTools.nix new file mode 100644 index 0000000..a460773 --- /dev/null +++ b/pkgs/override/gitAndTools.nix @@ -0,0 +1,5 @@ +self: super: + +super.gitAndTools // { + inherit (self) diff-so-fancy; +} diff --git a/pkgs/override/input-fonts.nix b/pkgs/override/input-fonts.nix new file mode 100644 index 0000000..6ee7afa --- /dev/null +++ b/pkgs/override/input-fonts.nix @@ -0,0 +1,13 @@ +self: super: + +super.input-fonts.overrideAttrs (old: rec { + src = self.fetchzip { + url = "http://xu.r/~tv/mirrors/input-fonts/Input-Font-2.zip"; + sha256 = "1q58x92nm7dk9ylp09pvgj74nxkywvqny3xmfighnsl30dv42fcr"; + stripRoot = false; + }; + sourceRoot = null; + outputHash = null; + outputHashAlgo = null; + outputHashMode = null; +}) diff --git a/pkgs/override/iosevka-tv-1.nix b/pkgs/override/iosevka-tv-1.nix new file mode 100644 index 0000000..880160b --- /dev/null +++ b/pkgs/override/iosevka-tv-1.nix @@ -0,0 +1,20 @@ +self: super: + +let + srcpkg = super.iosevka-tv-1; + binpkg = self.fetchzip { + inherit (srcpkg) pname version; + stripRoot = false; + hash = "sha256-QIuTS70vUQSvDDXjY4uI6SCcu1XT4HjvzpthvrNX4h0="; + urls = [ + "https://c.krebsco.de/${srcpkg.name}.tar.gz" + "https://ni.krebsco.de/~tv/mirrors/iosevka/${srcpkg.name}.tar.gz" + ]; + }; +in + +if srcpkg.version == binpkg.version then + binpkg + +else + srcpkg diff --git a/pkgs/override/iosevka-tv-2.nix b/pkgs/override/iosevka-tv-2.nix new file mode 100644 index 0000000..2eecf3c --- /dev/null +++ b/pkgs/override/iosevka-tv-2.nix @@ -0,0 +1,20 @@ +self: super: + +let + srcpkg = super.iosevka-tv-2; + binpkg = self.fetchzip { + inherit (srcpkg) pname version; + stripRoot = false; + hash = "sha256-PuIrW1ftYD5PW4du6gq1XpUM3v0potwmj+vAxJImF/A="; + urls = [ + "https://c.krebsco.de/${srcpkg.name}.tar.gz" + "https://ni.krebsco.de/~tv/mirrors/iosevka/${srcpkg.name}.tar.gz" + ]; + }; +in + +if srcpkg.version == binpkg.version then + binpkg + +else + srcpkg diff --git a/pkgs/override/jc.nix b/pkgs/override/jc.nix new file mode 100644 index 0000000..346dd3e --- /dev/null +++ b/pkgs/override/jc.nix @@ -0,0 +1,21 @@ +self: super: + +let + version = "1.21.0"; +in + +# Prevent downgrades. +assert self.lib.versionAtLeast version super.jc.version; + +self.python3.pkgs.toPythonApplication + (self.python3.pkgs.jc.overrideAttrs + (oldAttrs: { + name = "jc-${version}"; + version = version; + src = self.fetchFromGitHub { + owner = "kellyjonbrazil"; + repo = "jc"; + rev = "v${version}"; + sha256 = "sha256-kS42WokR7ZIqIPi8LbX4tmtjn37tckea2ELbuqzTm2o"; + }; + })) diff --git a/pkgs/override/uqmi.nix b/pkgs/override/uqmi.nix new file mode 100644 index 0000000..1eaecbd --- /dev/null +++ b/pkgs/override/uqmi.nix @@ -0,0 +1,10 @@ +self: super: + +super.uqmi.overrideAttrs (old: { + version = "unstable-2022-05-04"; + src = self.fetchgit { + url = "https://git.openwrt.org/project/uqmi.git"; + rev = "56cb2d4056fef132ccf78dfb6f3074ae5d109992"; + hash = "sha256-PwnR24PbNKfLrsBlU5JTOHDzs/9Wgcuwfnu3dJuuZcM="; + }; +}) -- cgit v1.2.3