From 2de8aeb09a29551857814ab56dd82e1e5022f4bb Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 3 Jan 2021 17:00:07 +0100 Subject: crx: init at 1.0.0 --- krebs/5pkgs/simple/crx/default.nix | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 krebs/5pkgs/simple/crx/default.nix (limited to 'krebs') diff --git a/krebs/5pkgs/simple/crx/default.nix b/krebs/5pkgs/simple/crx/default.nix new file mode 100644 index 000000000..180c6e727 --- /dev/null +++ b/krebs/5pkgs/simple/crx/default.nix @@ -0,0 +1,49 @@ +{ lib, pkgs, stdenv }: + +stdenv.mkDerivation rec { + pname = "crx"; + version = "1.0.0"; + + src = pkgs.fetchgit { + url = https://cgit.krebsco.de/crx; + rev = "refs/tags/v${version}"; + sha256 = "0nrbqw94lb0fzk9991vaqplszqzdij6vbf1kb2hi48a9bzg8h6z3"; + }; + + phases = [ + "unpackPhase" + "installPhase" + ]; + + installPhase = '' + mkdir -p $out/bin + + ${lib.concatStrings + (lib.mapAttrsToList + (name: path: /* sh */ '' + sed \ + 's,^set -efu$,&\nPATH=${lib.makeBinPath path}; export PATH,' \ + < ./${name} \ + > $out/bin/${name} + chmod +x $out/bin/${name} + '') + { + crxid = [ + pkgs.bc + pkgs.coreutils + pkgs.gnused + pkgs.openssl + pkgs.xxd + ]; + crxmake = [ + pkgs.coreutils + pkgs.gnused + pkgs.openssl + pkgs.xxd + pkgs.zip + ]; + } + ) + } + ''; +} -- cgit v1.2.3 From 3ef1e814227ed05f3715e7adcba5650abba241b5 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 4 Jan 2021 15:05:00 +0100 Subject: crx: 1.0.0 -> 1.1.0 --- krebs/5pkgs/simple/crx/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'krebs') diff --git a/krebs/5pkgs/simple/crx/default.nix b/krebs/5pkgs/simple/crx/default.nix index 180c6e727..429a471df 100644 --- a/krebs/5pkgs/simple/crx/default.nix +++ b/krebs/5pkgs/simple/crx/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "crx"; - version = "1.0.0"; + version = "1.1.0"; src = pkgs.fetchgit { url = https://cgit.krebsco.de/crx; rev = "refs/tags/v${version}"; - sha256 = "0nrbqw94lb0fzk9991vaqplszqzdij6vbf1kb2hi48a9bzg8h6z3"; + sha256 = "10xwrdxwbvqydayg6a4jcl3cfp4wi9ssm7a0dlnclkc4rmf6sv4a"; }; phases = [ @@ -31,6 +31,7 @@ stdenv.mkDerivation rec { crxid = [ pkgs.bc pkgs.coreutils + pkgs.file pkgs.gnused pkgs.openssl pkgs.xxd -- cgit v1.2.3 From cbb28f34eee5b5c801dc0521d88ffae0cd1a4c81 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 4 Jan 2021 17:18:23 +0100 Subject: TabFS: init --- krebs/5pkgs/simple/TabFS/default.nix | 100 +++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 krebs/5pkgs/simple/TabFS/default.nix (limited to 'krebs') diff --git a/krebs/5pkgs/simple/TabFS/default.nix b/krebs/5pkgs/simple/TabFS/default.nix new file mode 100644 index 000000000..23fdf519d --- /dev/null +++ b/krebs/5pkgs/simple/TabFS/default.nix @@ -0,0 +1,100 @@ +{ lib, pkgs, stdenv }: + +stdenv.mkDerivation rec { + name = "TabFS"; + + src = pkgs.fetchgit { + url = https://cgit.krebsco.de/TabFS; + rev = "1fc4845283a0e6aa46a8d8978f356d5ccdcedd13"; + sha256 = "0bsm5fhxrr6zwbnm9p10h9pwm85llr02g2ch97a62r62dhjjrc8h"; + }; + + phases = [ + "unpackPhase" + "buildPhase" + "installPhase" + ]; + + nativeBuildInputs = [ + pkgs.jq + ]; + + buildInputs = [ + pkgs.fuse + ]; + + buildPhase = '' + make -C fs + ''; + + installPhase = '' + mkdir -p $out/bin + + cp fs/tabfs $out/bin + + ${lib.concatStrings + (lib.mapAttrsToList + (name: spec: /* sh */ '' + jq < ${spec.source} > $out/bin/${name} \ + --arg out $out \ + --arg path ${lib.makeBinPath spec.path} \ + -Rrs \ + ${lib.escapeShellArg /* jq */ '' + def when(cond; update): if cond then update else . end; + + split("\n") | + map(${lib.concatMapStringsSep "|" (filter: "(${filter})") + (lib.toList (spec.filter or []) ++ [ + /* jq */ ''when(test("^#!"); "\(.)\nexport PATH=\($path)")'' + ]) + }) | + join("\n") + ''} + chmod +x $out/bin/${name} + '') + { + tabfs-enable-native-messaging = { + source = "install.sh"; + path = [ + pkgs.coreutils + ]; + filter = /* jq */'' + when(test("^EXE_PATH="); "EXE_PATH=\($out)/bin/tabfs-wrapper") + ''; + }; + tabfs-wrapper = { + source = "fs/tabfs-wrapper"; + path = [ + pkgs.coreutils + pkgs.findutils + pkgs.gnugrep + pkgs.procps + "/run/wrappers" # for fusermount + ]; + }; + tabfs-build-crx = { + source = "build-crx.sh"; + path = [ + pkgs.coreutils + pkgs.crx + pkgs.gnugrep + pkgs.jq + pkgs.openssl + ]; + filter = /* jq */'' + when(test("^source_dir="); + sub("\\$\\(dirname \"\\$0\"\\)"; ${builtins.toJSON src}) + ) + ''; + }; + tabfs-install-crx = { + source = "install-crx.sh"; + path = [ + pkgs.coreutils + ]; + }; + } + ) + } + ''; +} -- cgit v1.2.3