From 1d571e614d993bf747fff7c5211d50315744de94 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 08:53:22 +0100 Subject: tv nix-prefetch-github: rip --- tv/5pkgs/override/default.nix | 2 -- tv/5pkgs/override/nix-prefetch-github.nix | 47 ------------------------------- 2 files changed, 49 deletions(-) delete mode 100644 tv/5pkgs/override/nix-prefetch-github.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix index 4fb2e806..9d06e106 100644 --- a/tv/5pkgs/override/default.nix +++ b/tv/5pkgs/override/default.nix @@ -19,6 +19,4 @@ self: super: { outputHashMode = null; }); - nix-prefetch-github = - self.python3Packages.callPackage ./nix-prefetch-github.nix {}; } diff --git a/tv/5pkgs/override/nix-prefetch-github.nix b/tv/5pkgs/override/nix-prefetch-github.nix deleted file mode 100644 index 67873f92..00000000 --- a/tv/5pkgs/override/nix-prefetch-github.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ fetchPypi -, lib -, buildPythonPackage -, pythonOlder -, attrs -, click -, effect -, jinja2 -, git -, pytestCheckHook -, pytest-black -, pytestcov -, pytest-isort -}: - -buildPythonPackage rec { - pname = "nix-prefetch-github"; - version = "3.0"; - - src = fetchPypi { - inherit pname version; - sha256 = "sha256-EN+EbVXUaf+id5UsK4EBm/9k9FYaH79g08kblvW60XA="; - }; - - propagatedBuildInputs = [ - attrs - click - effect - jinja2 - ]; - - checkInputs = [ pytestCheckHook pytest-black pytestcov pytest-isort git ]; - checkPhase = '' - pytest -m 'not network' - ''; - - # latest version of isort will cause tests to fail - # ignore tests which are impure - disabledTests = [ "isort" "life" "outputs" "fetch_submodules" ]; - - meta = with lib; { - description = "Prefetch sources from github"; - homepage = "https://github.com/seppeljordan/nix-prefetch-github"; - license = licenses.gpl3; - maintainers = with maintainers; [ seppeljordan ]; - }; -} -- cgit v1.2.3 From 34f290f69e9f96e5bf27a8c4c9d354f9e88c515c Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 08:54:54 +0100 Subject: tv overrides: mapNixDir --- tv/5pkgs/override/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix index 9d06e106..dc8fc590 100644 --- a/tv/5pkgs/override/default.nix +++ b/tv/5pkgs/override/default.nix @@ -20,3 +20,5 @@ self: super: { }); } +// +mapNixDir (path: import path self super) ./. -- cgit v1.2.3 From b7f21925de63a03eec47aa42e206d0a5cdb82f2d Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 09:00:16 +0100 Subject: tv pkgs: move fzf to override --- tv/5pkgs/override/default.nix | 7 ----- tv/5pkgs/override/fzf.complete1.patch | 55 ----------------------------------- tv/5pkgs/override/fzf/complete1.patch | 55 +++++++++++++++++++++++++++++++++++ tv/5pkgs/override/fzf/default.nix | 9 ++++++ 4 files changed, 64 insertions(+), 62 deletions(-) delete mode 100644 tv/5pkgs/override/fzf.complete1.patch create mode 100644 tv/5pkgs/override/fzf/complete1.patch create mode 100644 tv/5pkgs/override/fzf/default.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix index dc8fc590..8a0c1087 100644 --- a/tv/5pkgs/override/default.nix +++ b/tv/5pkgs/override/default.nix @@ -1,12 +1,5 @@ with import ; 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 or ""} - ''; - }); input-fonts = super.input-fonts.overrideAttrs (old: rec { src = self.fetchzip { 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 deleted file mode 100644 index 4b2126a2..00000000 --- a/tv/5pkgs/override/fzf.complete1.patch +++ /dev/null @@ -1,55 +0,0 @@ -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/fzf/complete1.patch b/tv/5pkgs/override/fzf/complete1.patch new file mode 100644 index 00000000..4b2126a2 --- /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/fzf/default.nix b/tv/5pkgs/override/fzf/default.nix new file mode 100644 index 00000000..661db0ed --- /dev/null +++ b/tv/5pkgs/override/fzf/default.nix @@ -0,0 +1,9 @@ +self: super: + +super.fzf.overrideAttrs (old: { + # XXX cannot use `patches` because fzf has a custom patchPhase + patchPhase = '' + patch -Np1 < ${./complete1.patch} + ${old.patchPhase or ""} + ''; +}) -- cgit v1.2.3 From ad6e957a51d0e7f3e4090ed3eadc910e8ce75695 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 09:04:34 +0100 Subject: tv pkgs: move input-font to override --- tv/5pkgs/override/default.nix | 15 +-------------- tv/5pkgs/override/input-fonts.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 tv/5pkgs/override/input-fonts.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix index 8a0c1087..4cc4749d 100644 --- a/tv/5pkgs/override/default.nix +++ b/tv/5pkgs/override/default.nix @@ -1,17 +1,4 @@ with import ; -self: super: { - input-fonts = 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; - }); +self: super: -} -// mapNixDir (path: import path self super) ./. diff --git a/tv/5pkgs/override/input-fonts.nix b/tv/5pkgs/override/input-fonts.nix new file mode 100644 index 00000000..6ee7afac --- /dev/null +++ b/tv/5pkgs/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; +}) -- cgit v1.2.3 From 09fa6fbad69eed0083f950afbe0bbb6226b2043a Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 09:46:11 +0100 Subject: tv pkgs: import files and dirs as overlays harder --- tv/5pkgs/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix index cae5da11..9e9a3a9b 100644 --- a/tv/5pkgs/default.nix +++ b/tv/5pkgs/default.nix @@ -3,12 +3,13 @@ with import ; self: super: # Import files and subdirectories like they are overlays. -foldl' mergeAttrs {} - (map - (name: import (./. + "/${name}") self super) - (filter - (name: name != "default.nix" && !hasPrefix "." name) - (attrNames (readDir ./.)))) +fix + (foldl' (flip extends) (_: super) + (map + (name: import (./. + "/${name}")) + (filter + (name: name != "default.nix" && !hasPrefix "." name) + (attrNames (readDir ./.))))) // -- cgit v1.2.3 From 5aff05de1b6130d45b7cd52cd18aab511de112a7 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 09:53:21 +0100 Subject: tv pkgs: import override last --- tv/5pkgs/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix index 9e9a3a9b..ea860c7d 100644 --- a/tv/5pkgs/default.nix +++ b/tv/5pkgs/default.nix @@ -1,4 +1,11 @@ with import ; +let + pushBack = x: xs: + if elem x xs then + remove x xs ++ [ x ] + else + names; +in self: super: @@ -9,7 +16,8 @@ fix (name: import (./. + "/${name}")) (filter (name: name != "default.nix" && !hasPrefix "." name) - (attrNames (readDir ./.))))) + (pushBack "override" + (attrNames (readDir ./.)))))) // -- cgit v1.2.3 From 066dba941a7b6eebe34290a0973acddf60239896 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 10:03:50 +0100 Subject: tv pkgs: move cr to simple --- tv/5pkgs/default.nix | 15 --------------- tv/5pkgs/simple/cr.nix | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 tv/5pkgs/simple/cr.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix index ea860c7d..d1b73dbb 100644 --- a/tv/5pkgs/default.nix +++ b/tv/5pkgs/default.nix @@ -22,21 +22,6 @@ fix // { - 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="$cache_dir" \ - --disk-cache-size=50000000 \ - "$@" - ''; - dhcpcd = overrideDerivation super.dhcpcd (old: { configureFlags = old.configureFlags ++ [ "--dbdir=/var/lib/dhcpcd" diff --git a/tv/5pkgs/simple/cr.nix b/tv/5pkgs/simple/cr.nix new file mode 100644 index 00000000..048d7795 --- /dev/null +++ b/tv/5pkgs/simple/cr.nix @@ -0,0 +1,16 @@ +{ pkgs }: + +pkgs.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 ${pkgs.chromium}/bin/chromium \ + --ssl-version-min=tls1 \ + --disk-cache-dir="$cache_dir" \ + --disk-cache-size=50000000 \ + "$@" +'' -- cgit v1.2.3 From 63654bf03a7ec1d97828b196369249ec8fb742f9 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 10:05:06 +0100 Subject: tv pkgs: move dhcpcd to override --- tv/5pkgs/default.nix | 6 ------ tv/5pkgs/override/dhcpcd.nix | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 tv/5pkgs/override/dhcpcd.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix index d1b73dbb..e2575300 100644 --- a/tv/5pkgs/default.nix +++ b/tv/5pkgs/default.nix @@ -22,12 +22,6 @@ fix // { - dhcpcd = overrideDerivation super.dhcpcd (old: { - configureFlags = old.configureFlags ++ [ - "--dbdir=/var/lib/dhcpcd" - ]; - }); - gitAndTools = super.gitAndTools // { inherit (self) diff-so-fancy; }; diff --git a/tv/5pkgs/override/dhcpcd.nix b/tv/5pkgs/override/dhcpcd.nix new file mode 100644 index 00000000..202b8e5d --- /dev/null +++ b/tv/5pkgs/override/dhcpcd.nix @@ -0,0 +1,7 @@ +self: super: + +self.lib.overrideDerivation super.dhcpcd (old: { + configureFlags = old.configureFlags ++ [ + "--dbdir=/var/lib/dhcpcd" + ]; +}) -- cgit v1.2.3 From 9958dc259074188fc315d2889629a05d6d0e6e01 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 10:05:55 +0100 Subject: tv pkgs: move gitAndTools to override --- tv/5pkgs/default.nix | 4 ---- tv/5pkgs/override/gitAndTools.nix | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 tv/5pkgs/override/gitAndTools.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix index e2575300..59b8f82c 100644 --- a/tv/5pkgs/default.nix +++ b/tv/5pkgs/default.nix @@ -22,10 +22,6 @@ fix // { - gitAndTools = super.gitAndTools // { - inherit (self) diff-so-fancy; - }; - ff = self.writeDashBin "ff" '' exec ${self.firefoxWrapper}/bin/firefox "$@" ''; diff --git a/tv/5pkgs/override/gitAndTools.nix b/tv/5pkgs/override/gitAndTools.nix new file mode 100644 index 00000000..a460773b --- /dev/null +++ b/tv/5pkgs/override/gitAndTools.nix @@ -0,0 +1,5 @@ +self: super: + +super.gitAndTools // { + inherit (self) diff-so-fancy; +} -- cgit v1.2.3 From 7a11725440213d698701ed3430a239061780b9e5 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 10:07:46 +0100 Subject: tv pkgs: move ff to simple --- tv/5pkgs/default.nix | 4 ---- tv/5pkgs/simple/ff.nix | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 tv/5pkgs/simple/ff.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix index 59b8f82c..dc553b8e 100644 --- a/tv/5pkgs/default.nix +++ b/tv/5pkgs/default.nix @@ -22,10 +22,6 @@ fix // { - ff = self.writeDashBin "ff" '' - exec ${self.firefoxWrapper}/bin/firefox "$@" - ''; - gnupg = self.gnupg22; } diff --git a/tv/5pkgs/simple/ff.nix b/tv/5pkgs/simple/ff.nix new file mode 100644 index 00000000..ec20c4a2 --- /dev/null +++ b/tv/5pkgs/simple/ff.nix @@ -0,0 +1,5 @@ +{ pkgs }: + +pkgs.writeDashBin "ff" '' + exec ${pkgs.firefoxWrapper}/bin/firefox "$@" +'' -- cgit v1.2.3 From b4e2179efecd5b5d6915f8107e335a309de7c67e Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 10:09:18 +0100 Subject: tv pkgs: don't override gnupg --- tv/5pkgs/default.nix | 7 ------- 1 file changed, 7 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix index dc553b8e..2b9bdeeb 100644 --- a/tv/5pkgs/default.nix +++ b/tv/5pkgs/default.nix @@ -18,10 +18,3 @@ fix (name: name != "default.nix" && !hasPrefix "." name) (pushBack "override" (attrNames (readDir ./.)))))) - -// - -{ - gnupg = self.gnupg22; - -} -- cgit v1.2.3 From 6bcbb9adae290249988c86da35b2b5236df6ce96 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 5 Mar 2022 08:56:43 +0100 Subject: tv anbox: init at unstable-2021-05-26 --- tv/5pkgs/override/anbox.nix | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 tv/5pkgs/override/anbox.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/override/anbox.nix b/tv/5pkgs/override/anbox.nix new file mode 100644 index 00000000..39406173 --- /dev/null +++ b/tv/5pkgs/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"; + }) + ]; +}) -- cgit v1.2.3