diff options
Diffstat (limited to 'krebs/5pkgs/simple')
54 files changed, 132 insertions, 980 deletions
diff --git a/krebs/5pkgs/simple/K_belwagen.nix b/krebs/5pkgs/simple/K_belwagen.nix deleted file mode 100644 index 2f64bb09d..000000000 --- a/krebs/5pkgs/simple/K_belwagen.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib, pkgs, stdenv }: - -stdenv.mkDerivation { - pname = "K_belwagen"; - version = "1.0"; - - src = pkgs.painload; - sourceRoot = "source/K_belwagen"; - - buildInputs = [ - pkgs.jack1 - pkgs.pkg-config - ]; - - patchPhase = '' - sed -i ' - s@^cd@# &@ - s@^make@# &@ - s@^jackd@# &@ - s@^trap@# &@ - - s@^set.*@&\nPATH=${lib.makeBinPath [ - pkgs.bc - pkgs.coreutils - ]}; export PATH@ - - s@\./a\.out@'"$out"'/lib/a.out@ - ' alarm - ''; - - installPhase = '' - mkdir -p $out/lib - mkdir -p $out/bin - - cp alarm $out/bin - cp a.out $out/lib - ''; -} diff --git a/krebs/5pkgs/simple/TabFS/src.json b/krebs/5pkgs/simple/TabFS/src.json index 24e36aef3..931c9ecb8 100644 --- a/krebs/5pkgs/simple/TabFS/src.json +++ b/krebs/5pkgs/simple/TabFS/src.json @@ -1,8 +1,6 @@ { "url": "https://cgit.krebsco.de/TabFS", "rev": "a6045e0e29b85e3e66c468f3561009ded1db6ec5", - "date": "2021-01-14T23:56:09+01:00", - "path": "/nix/store/mbcywm1yq5vr7awxqb533faz34minfax-TabFS", "sha256": "1z0kj95zh0jl8laa0whra1jys8pws3199sy29vmlv2nxrkz13blv", "fetchSubmodules": false, "deepClone": false, diff --git a/krebs/5pkgs/simple/airdcpp-webclient/default.nix b/krebs/5pkgs/simple/airdcpp-webclient/default.nix index 754fecf9c..f4634b595 100644 --- a/krebs/5pkgs/simple/airdcpp-webclient/default.nix +++ b/krebs/5pkgs/simple/airdcpp-webclient/default.nix @@ -4,7 +4,7 @@ stdenv.mkDerivation rec { name = "airdcpp-webclient-${version}"; version = "2.3.0"; - + src = fetchurl { url = http://web-builds.airdcpp.net/stable/airdcpp_2.3.0_webui-2.3.0_64-bit_portable.tar.gz; sha256 = "0yvcl0nc70fghc7vfsgvbpryi5q97arld8adql4way4qa0mdnyv1"; diff --git a/krebs/5pkgs/simple/bepasty-client-cli/default.nix b/krebs/5pkgs/simple/bepasty-client-cli/default.nix deleted file mode 100644 index 7811ef5fc..000000000 --- a/krebs/5pkgs/simple/bepasty-client-cli/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, pkgs, pythonPackages, fetchFromGitHub, ... }: - -with pythonPackages; buildPythonPackage rec { - name = "bepasty-client-cli"; - propagatedBuildInputs = [ - python_magic - click - requests - ]; - - src = fetchFromGitHub { - owner = "bepasty"; - repo = "bepasty-client-cli"; - rev = "4b7135ba8ba1e17501de08ad7b6aca73c0d949d2"; - sha256 = "1svchyk9zai1vip9ppm12jm7wfjbdr9ijhgcd2n10xh73jrn9cnc"; - }; - - meta = { - homepage = https://github.com/bepasty/bepasty-client-cli; - description = "CLI client for bepasty-server"; - license = lib.licenses.bsd2; - }; -} diff --git a/krebs/5pkgs/simple/bling/default.nix b/krebs/5pkgs/simple/bling/default.nix index 1c8610325..186aaa85e 100644 --- a/krebs/5pkgs/simple/bling/default.nix +++ b/krebs/5pkgs/simple/bling/default.nix @@ -1,4 +1,7 @@ -{ imagemagick, runCommand, stockholm, ... }: +{ imagemagick, runCommand, lib, ... }: +let + stockholm.lib = import ../../../../lib/pure.nix { inherit lib; }; +in with stockholm.lib; let diff --git a/krebs/5pkgs/simple/brain/default.nix b/krebs/5pkgs/simple/brain/default.nix index d7e36a527..9f183cfe9 100644 --- a/krebs/5pkgs/simple/brain/default.nix +++ b/krebs/5pkgs/simple/brain/default.nix @@ -4,25 +4,30 @@ let pass = pkgs.pass.withExtensions (ext: [ ext.pass-otp ]); -in -pkgs.write "brain" { - "/bin/brain".link = pkgs.writeDash "brain" '' + brain = pkgs.writeDash "brain" '' PASSWORD_STORE_DIR=$HOME/brain \ exec ${pass}/bin/pass "$@" ''; - "/bin/brainmenu".link = pkgs.writeDash "brainmenu" '' + + brainmenu = pkgs.writeDash "brainmenu" '' PASSWORD_STORE_DIR=$HOME/brain \ exec ${pass}/bin/passmenu "$@" ''; - "/share/bash-completion/completions/brain".link = - pkgs.runCommand "brain-completions" { - } /* sh */ '' - sed -r ' - s/\<_pass?(_|\>)/_brain\1/g - s/\<__password_store/_brain/g - s/\<pass\>/brain/ - s/\$HOME\/\.password-store/$HOME\/brain/ - ' < ${pass}/share/bash-completion/completions/pass > $out - ''; -} + + completions = pkgs.runCommand "brain-completions" {} '' + sed -r ' + s/\<_pass?(_|\>)/_brain\1/g + s/\<__password_store/_brain/g + s/\<pass\>/brain/ + s/\$HOME\/\.password-store/$HOME\/brain/ + ' < ${pass}/share/bash-completion/completions/pass > $out + ''; +in + +pkgs.runCommand "brain" {} '' + mkdir -p $out/bin $out/share/bash-completion/completions + ln -s ${brain} $out/bin/brain + ln -s ${brainmenu} $out/bin/brainmenu + ln -s ${completions} $out/share/bash-completion/completions/brain +'' diff --git a/krebs/5pkgs/simple/buildbot-classic-slave/default.nix b/krebs/5pkgs/simple/buildbot-classic-slave/default.nix deleted file mode 100644 index a48c45ae0..000000000 --- a/krebs/5pkgs/simple/buildbot-classic-slave/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ coreutils, fetchgit, git, buildbot-classic, python2Packages, ... }: - -python2Packages.buildPythonApplication { - name = "buildbot-classic-slave-${buildbot-classic.version}"; - namePrefix = ""; - - src = buildbot-classic.src; - postUnpack = "sourceRoot=\${sourceRoot}/slave"; - - nativeBuildInputs = [ git ]; - propagatedBuildInputs = [ python2Packages.twisted ]; - doCheck = false; - - postInstall = '' - mkdir -p "$out/share/man/man1" - cp docs/buildslave.1 "$out/share/man/man1" - ''; -} diff --git a/krebs/5pkgs/simple/cac-panel/default.nix b/krebs/5pkgs/simple/cac-panel/default.nix deleted file mode 100644 index 57f58f4de..000000000 --- a/krebs/5pkgs/simple/cac-panel/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{pkgs, python3Packages, ...}: - -python3Packages.buildPythonPackage rec { - name = "cac-panel-${version}"; - version = "0.4.4"; - - src = pkgs.fetchurl { - url = "https://pypi.python.org/packages/source/c/cac-panel/cac-panel-${version}.tar.gz"; - sha256 = "16bx67fsbgwxciik42jhdnfzxx1xp5b0rimzrif3r7h4fawlnld8"; - }; - - propagatedBuildInputs = with python3Packages; [ - docopt - requests - beautifulsoup4 - ]; -} - diff --git a/krebs/5pkgs/simple/certaids.nix b/krebs/5pkgs/simple/certaids.nix deleted file mode 100644 index 34f4c3e14..000000000 --- a/krebs/5pkgs/simple/certaids.nix +++ /dev/null @@ -1,109 +0,0 @@ -{ pkgs }: - -pkgs.write "certaids" { - "/bin/cert2json".link = pkgs.writeDash "cert2json" '' - # usage: cert2json < CERT > JSON - set -efu - - ${pkgs.openssl}/bin/openssl crl2pkcs7 -nocrl -certfile /dev/stdin | - ${pkgs.openssl}/bin/openssl pkcs7 -print_certs -text | - ${pkgs.gawk}/bin/awk -F, -f ${pkgs.writeText "cert2json.awk" '' - function abort(msg) { - print(msg) > "/dev/stderr" - exit 1 - } - - function toJSON(x, type, ret) { - type = typeof(x) - switch (type) { - case "array": - if (isArray(x)) return arrayToJSON(x) - if (isObject(x)) return objectToJSON(x) - abort("cannot render array to JSON", x) - case "number": - return numberToJSON(x) - case "string": - return stringToJSON(x) - case "strnum": - case "unassigned": - case "regexp": - case "untyped": - default: - abort("cannot render type: " type) - } - } - - function isArray(x, i, k) { - i = 1 - for (k in x) { - if (k != i++) return 0 - i++ - } - return 1 - } - - function isObject(x, k) { - for (k in x) { - if (typeof(k) != "string") return 0 - } - return 1 - } - - function arrayToJSON(x, k, ret) { - ret = "[" - for (k in x) { - ret=ret toJSON(x[k]) "," - } - sub(/,$/,"",ret) - ret=ret "]" - return ret - } - - function objectToJSON(x, k,ret) { - ret = "{" - for (k in x) { - ret = ret toJSON(k) ":" toJSON(x[k]) "," - } - sub(/,$/, "", ret) - ret = ret "}" - return ret - } - - function numberToJSON(x) { - return x - } - - function stringToJSON(x) { - gsub(/\\/, "&&",x) - gsub(/\n/, "\\n", x) - return "\"" x "\"" - } - - $1 ~ /^ *(Subject|Issuer):/ { - sub(/^ */, "") - sub(/: */, ",") - key=tolower($1) - sub(/[^,]*,/, "") - - # Normalize separators between relative distinguished names. - # [1]: RFC2253, 3. Parsing a String back to a Distinguished Name - # TODO support any distinguished name - gsub(/ *[;,] */, ",") - - for(i = 0; i <= NF; i++) { - split($i, a, "=") - cache[key][a[1]] = a[2] - } - } - - /BEGIN CERTIFICATE/,/END CERTIFICATE/{ - cache["certificate"] = cache["certificate"] $0 "\n" - } - - /END CERTIFICATE/{ - print toJSON(cache) - delete cache - } - ''} - ''; -} diff --git a/krebs/5pkgs/simple/cgit-clear-cache.nix b/krebs/5pkgs/simple/cgit-clear-cache.nix index 31a2eccb3..e630a4066 100644 --- a/krebs/5pkgs/simple/cgit-clear-cache.nix +++ b/krebs/5pkgs/simple/cgit-clear-cache.nix @@ -1,4 +1,8 @@ -{ cache-root ? "/tmp/cgit", findutils, stockholm, writeDashBin }: +{ cache-root ? "/tmp/cgit", findutils, lib, writeDashBin }: + +let + stockholm.lib = import ../../../lib/pure.nix { inherit lib; }; +in writeDashBin "cgit-clear-cache" '' set -efu diff --git a/krebs/5pkgs/simple/collectd-connect-time/default.nix b/krebs/5pkgs/simple/collectd-connect-time/default.nix index 525388029..abbfae40a 100644 --- a/krebs/5pkgs/simple/collectd-connect-time/default.nix +++ b/krebs/5pkgs/simple/collectd-connect-time/default.nix @@ -1,8 +1,10 @@ -{lib, pkgs, pythonPackages, fetchurl, ... }: +{lib, pkgs, python3Packages, fetchurl, ... }: -pythonPackages.buildPythonPackage rec { +python3Packages.buildPythonPackage rec { name = "collectd-connect-time-${version}"; version = "0.3.0"; + pyproject = true; + build-system = [ python3Packages.setuptools ]; src = fetchurl { url = "https://pypi.python.org/packages/source/c/collectd-connect-time/collectd-connect-time-${version}.tar.gz"; sha256 = "0vvrf9py9bwc8hk3scxwg4x2j8jlp2qva0mv4q8d9m4b4mk99c95"; diff --git a/krebs/5pkgs/simple/cunicu.nix b/krebs/5pkgs/simple/cunicu.nix index 4375a760c..8e193d455 100644 --- a/krebs/5pkgs/simple/cunicu.nix +++ b/krebs/5pkgs/simple/cunicu.nix @@ -1,6 +1,6 @@ { lib, pkgs }: -pkgs.buildGo120Module rec { +pkgs.buildGoModule rec { pname = "cunicu"; version = "g${lib.substring 0 7 src.rev}"; diff --git a/krebs/5pkgs/simple/default.nix b/krebs/5pkgs/simple/default.nix index 76ad6ff10..e0b9ffdae 100644 --- a/krebs/5pkgs/simple/default.nix +++ b/krebs/5pkgs/simple/default.nix @@ -3,8 +3,9 @@ self: super: let # This callPackage will try to detect obsolete overrides. lib = super.stockholm.lib; + callPackage' = lib.callPackageWith self; callPackage = path: args: let - override = self.callPackage path args; + override = callPackage' path args; upstream = lib.optionalAttrs (override ? "name") (super.${(lib.parseDrvName override.name).name} or {}); in if upstream ? "name" && @@ -12,5 +13,15 @@ let lib.compareVersions upstream.name override.name != -1 then lib.trace "Upstream `${upstream.name}' gets overridden by `${override.name}'." override else override; + + ## This callPackage will try to detect obsolete overrides. + #callPackage = path: args: let + # pname = (parseDrvName override.name).name; + # override = self.callPackage path args; + # upstream = super.${pname} or { name = ""; }; + #in + # override.overrideAttrs (old: { + # name = warnOldVersion upstream.name old.name; + # }); in lib.mapNixDir (path: callPackage path {}) ./. diff --git a/krebs/5pkgs/simple/dic/default.nix b/krebs/5pkgs/simple/dic/default.nix deleted file mode 100644 index 39402c012..000000000 --- a/krebs/5pkgs/simple/dic/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ fetchgit, lib, stdenv -, coreutils, curl, gnugrep, gnused, util-linux -}: - -stdenv.mkDerivation { - name = "dic"; - - src = fetchgit { - url = https://cgit.ni.krebsco.de/dic; - rev = "refs/tags/v1.1.1"; - sha256 = "1gbj967a5hj53fdkkxijqgwnl9hb8kskz0cmpjq7v65ffz3v6vag"; - }; - - phases = [ - "unpackPhase" - "installPhase" - ]; - - installPhase = - let - path = lib.makeBinPath [ - coreutils - curl - gnused - gnugrep - util-linux - ]; - in - '' - mkdir -p $out/bin - - sed \ - 's,^main() {$,&\n PATH=${path}; export PATH,' \ - < ./dic \ - > $out/bin/dic - - chmod +x $out/bin/dic - ''; -} diff --git a/krebs/5pkgs/simple/drivedroid-gen-repo/default.nix b/krebs/5pkgs/simple/drivedroid-gen-repo/default.nix deleted file mode 100644 index dee96d784..000000000 --- a/krebs/5pkgs/simple/drivedroid-gen-repo/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ fetchurl, lib, stdenv, python3Packages }: - -python3Packages.buildPythonPackage rec { - name = "drivedroid-gen-repo-${version}"; - version = "0.4.4"; - - propagatedBuildInputs = [ - python3Packages.docopt - ]; - - src = fetchurl { - url = "https://pypi.python.org/packages/source/d/drivedroid-gen-repo/drivedroid-gen-repo-${version}.tar.gz"; - sha256 = "09p58hzp61r5fp025lak9z52y0aakmaqpi59p9w5xq42dvy2hnvl"; - }; - - meta = { - homepage = http://krebsco.de/; - description = "Generate Drivedroid repos"; - license = lib.licenses.wtfpl; - }; -} - diff --git a/krebs/5pkgs/simple/ecrypt/default.nix b/krebs/5pkgs/simple/ecrypt/default.nix deleted file mode 100644 index f83f8cfe7..000000000 --- a/krebs/5pkgs/simple/ecrypt/default.nix +++ /dev/null @@ -1,111 +0,0 @@ -{ pkgs, lib }: - -#usage: ecrypt mount /var/crypted /var/unencrypted -pkgs.writers.writeDashBin "ecrypt" '' - set -euf - - PATH=${lib.makeBinPath (with pkgs; [ - coreutils - ecryptfs - gnused - gnugrep - jq - mount - keyutils - umount - ])} - - # turn echo back on if killed - trap 'stty echo' INT - - case "$1" in - init) - shift - mkdir -p "$1" "$2" - - # abort if src or dest are not empty - if [ -e "$1"/.cfg.json ]; then - echo 'source dir is already configured, aborting' - exit 1 - elif ls -1qA "$2" | grep -q .; then - echo 'destination dir is not empty, aborting' - exit 1 - else - # we start and exit ecryptfs-manager again to circumvent a bug where mounting the ecryptfs fails - echo 4 | ecryptfs-manager - stty -echo - printf "passphrase: " - read passphrase - stty echo - sig=$(echo "$passphrase" | ecryptfs-add-passphrase | grep 'Inserted auth tok' | sed 's/.*\[\(.*\)\].*/\1/') - mount -t ecryptfs \ - -o ecryptfs_unlink_sigs,ecryptfs_fnek_sig="$sig",ecryptfs_key_bytes=16,ecryptfs_cipher=aes,ecryptfs_sig="$sig" \ - "$1" "$2" - - # add sig to json state file - jq -n --arg sig "$sig" '{ "sig": $sig }' > "$1"/.cfg.json - fi - ;; - - mount) - shift - if ! [ -e "$1"/.cfg.json ]; then - echo '.cfg.json missing in src' - exit 1 - fi - old_sig=$(cat "$1"/.cfg.json | jq -r .sig) - - # check if key is already in keyring, otherwise add it - - if keyctl list @u | grep -q "$old_sig"; then - echo 'pw already saved' - else - # we start and exit ecryptfs-manager again to circumvent a bug where mounting the ecryptfs fails - echo 4 | ecryptfs-manager - stty -echo - printf "passphrase: " - read passphrase - stty echo - new_sig=$(echo "$passphrase" | ecryptfs-add-passphrase | grep 'Inserted auth tok' | sed 's/.*\[\(.*\)\].*/\1/') - - # check if passphrase matches sig - if [ "$old_sig" != "$new_sig" ]; then - echo 'passphrase does not match sig, bailing out' - new_keyid=$(keyctl list @u | grep "$new_sig" | sed 's/\([0-9]*\).*/\1/') - keyctl revoke "$new_keyid" - keyctl unlink "$new_keyid" - exit 1 - fi - fi - - sig=$old_sig - keyid=$(keyctl list @u | grep "$sig" | sed 's/\([0-9]*\).*/\1/') - if (ls -1qA "$2" | grep -q .); then - echo 'destination is not empty, bailing out' - exit 1 - else - mount -i -t ecryptfs \ - -o ecryptfs_passthrough=no,verbose=no,ecryptfs_unlink_sigs,ecryptfs_fnek_sig="$sig",ecryptfs_key_bytes=16,ecryptfs_cipher=aes,ecryptfs_sig="$sig" \ - "$1" "$2" - fi - ;; - - unmount) - shift - - sig=$(cat "$1"/.cfg.json | jq -r .sig) - keyid=$(keyctl list @u | grep "$sig" | sed 's/\s*\([0-9]*\).*/\1/') - - umount "$2" || : - keyctl revoke "$keyid" - keyctl unlink "$keyid" - ;; - - *) - echo 'usage: - ecrypt init /tmp/src/ /tmp/dst/ - ecrypt mount /tmp/src/ /tmp/dst/ - ecrypt unmount /tmp/src/ /tmp/dst/ - ' - esac -'' diff --git a/krebs/5pkgs/simple/eximlog.nix b/krebs/5pkgs/simple/eximlog.nix deleted file mode 100644 index 9e5ae8d63..000000000 --- a/krebs/5pkgs/simple/eximlog.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ jq, stockholm, systemd, writeDashBin }: - -let - lib = stockholm.lib; - user = "exim"; # TODO make this configurable -in - -# TODO execute eximlog only if journalctl doesn't fail -# bash's set -o pipefail isn't enough - -writeDashBin "eximlog" '' - ${systemd}/bin/journalctl \ - -u ${lib.shell.escape user} \ - -o short-unix \ - "$@" \ - | - ${jq}/bin/jq -Rr ' - # Only select lines that start with a timestamp - select(test("^[0-9]")) | - - split(" ") | - (.[0] | tonumber) as $time | - (.[3:] | join(" ")) as $message | - - "\($time | strftime("%Y-%m-%d %H:%M:%S %z")) \($message)" - - ' -'' |
