summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/5pkgs/simple')
-rw-r--r--krebs/5pkgs/simple/K_belwagen.nix38
-rw-r--r--krebs/5pkgs/simple/TabFS/src.json2
-rw-r--r--krebs/5pkgs/simple/airdcpp-webclient/default.nix2
-rw-r--r--krebs/5pkgs/simple/bepasty-client-cli/default.nix23
-rw-r--r--krebs/5pkgs/simple/bling/default.nix5
-rw-r--r--krebs/5pkgs/simple/brain/default.nix35
-rw-r--r--krebs/5pkgs/simple/buildbot-classic-slave/default.nix18
-rw-r--r--krebs/5pkgs/simple/cac-panel/default.nix18
-rw-r--r--krebs/5pkgs/simple/certaids.nix109
-rw-r--r--krebs/5pkgs/simple/cgit-clear-cache.nix6
-rw-r--r--krebs/5pkgs/simple/collectd-connect-time/default.nix6
-rw-r--r--krebs/5pkgs/simple/cunicu.nix2
-rw-r--r--krebs/5pkgs/simple/default.nix13
-rw-r--r--krebs/5pkgs/simple/dic/default.nix39
-rw-r--r--krebs/5pkgs/simple/drivedroid-gen-repo/default.nix22
-rw-r--r--krebs/5pkgs/simple/ecrypt/default.nix111
-rw-r--r--krebs/5pkgs/simple/eximlog.nix28
-rw-r--r--krebs/5pkgs/simple/font-size.nix1
-rw-r--r--krebs/5pkgs/simple/fortclientsslvpn/default.nix14
-rw-r--r--krebs/5pkgs/simple/ftb/default.nix6
-rw-r--r--krebs/5pkgs/simple/games-user-env/default.nix34
-rw-r--r--krebs/5pkgs/simple/generate-secrets/default.nix49
-rw-r--r--krebs/5pkgs/simple/git-hooks/default.nix7
-rw-r--r--krebs/5pkgs/simple/gitignore.nix46
-rw-r--r--krebs/5pkgs/simple/gnokii/default.nix4
-rw-r--r--krebs/5pkgs/simple/goify/default.nix4
-rw-r--r--krebs/5pkgs/simple/hashPassword/default.nix15
-rw-r--r--krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur36
-rw-r--r--krebs/5pkgs/simple/htgen/default.nix2
-rw-r--r--krebs/5pkgs/simple/internetarchive/default.nix39
-rw-r--r--krebs/5pkgs/simple/irc-announce/default.nix4
-rw-r--r--krebs/5pkgs/simple/krebspaste/default.nix12
-rw-r--r--krebs/5pkgs/simple/logf/default.nix112
-rw-r--r--krebs/5pkgs/simple/netcup/default.nix33
-rw-r--r--krebs/5pkgs/simple/nixos-format-error.nix107
-rw-r--r--krebs/5pkgs/simple/ovh-zone/default.nix6
-rw-r--r--krebs/5pkgs/simple/python-dnsstamps.nix2
-rw-r--r--krebs/5pkgs/simple/qrscan.nix7
-rw-r--r--krebs/5pkgs/simple/reaktor2-plugins/default.nix (renamed from krebs/5pkgs/simple/reaktor2-plugins.nix)10
-rwxr-xr-xkrebs/5pkgs/simple/reaktor2-plugins/scripts/random-emoji.sh (renamed from krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh)0
-rwxr-xr-xkrebs/5pkgs/simple/reaktor2-plugins/scripts/random-issue.sh (renamed from krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh)0
-rwxr-xr-xkrebs/5pkgs/simple/reaktor2-plugins/scripts/sed-plugin.py (renamed from krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py)0
-rwxr-xr-xkrebs/5pkgs/simple/reaktor2-plugins/scripts/shack-correct.sh (renamed from krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh)0
-rwxr-xr-xkrebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_join.sh (renamed from krebs/5pkgs/simple/Reaktor/scripts/tell-on_join.sh)0
-rwxr-xr-xkrebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh (renamed from krebs/5pkgs/simple/Reaktor/scripts/tell-on_privmsg.sh)0
-rw-r--r--krebs/5pkgs/simple/realwallpaper/default.nix9
-rw-r--r--krebs/5pkgs/simple/repo-sync/default.nix8
-rw-r--r--krebs/5pkgs/simple/ssh-audit.nix2
-rw-r--r--krebs/5pkgs/simple/tinc_graphs/default.nix6
-rw-r--r--krebs/5pkgs/simple/treq/default.nix8
-rw-r--r--krebs/5pkgs/simple/ukrepl.nix6
-rw-r--r--krebs/5pkgs/simple/untilport/default.nix6
-rw-r--r--krebs/5pkgs/simple/urix.nix17
-rw-r--r--krebs/5pkgs/simple/with-tmpdir/default.nix29
54 files changed, 136 insertions, 982 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)"
-
- '
-''
diff --git a/krebs/5pkgs/simple/font-size.nix b/krebs/5pkgs/simple/font-size.nix
index 21097ed6a..829325192 100644
--- a/krebs/5pkgs/simple/font-size.nix
+++ b/krebs/5pkgs/simple/font-size.nix
@@ -1,3 +1,4 @@
+# TODO kill me in favor of urxvt-resize-font
{ writeDashBin }:
writeDashBin "font-size" ''
set -efu
diff --git a/krebs/5pkgs/simple/fortclientsslvpn/default.nix b/krebs/5pkgs/simple/fortclientsslvpn/default.nix
index 1f86d6fe4..b895eef89 100644
--- a/krebs/5pkgs/simple/fortclientsslvpn/default.nix
+++ b/krebs/5pkgs/simple/fortclientsslvpn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, gnome3, glib, libSM, gdk_pixbuf, libX11, libXinerama, iproute,
+{ stdenv, lib, fetchurl, gtk3, glib, xorg, gdk-pixbuf, iproute2,
makeWrapper, libredirect, ppp, coreutils, gawk, pango }:
stdenv.mkDerivation rec {
name = "forticlientsslvpn";
@@ -31,12 +31,12 @@ stdenv.mkDerivation rec {
];
guiLibPath = lib.makeLibraryPath [
- gnome3.gtk
+ gtk3
glib
- libSM
- gdk_pixbuf
- libX11
- libXinerama
+ xorg.libSM
+ gdk-pixbuf
+ xorg.libX11
+ xorg.libXinerama
pango
];
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
cp -r 64bit/. "$out/opt/fortinet"
wrapProgram $out/opt/fortinet/forticlientsslvpn \
--set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
- --set NIX_REDIRECTS /usr/bin/tail=${coreutils}/bin/tail:/usr/sbin/ip=${iproute}/bin/ip:/usr/sbin/pppd=${ppp}/bin/pppd
+ --set NIX_REDIRECTS /usr/bin/tail=${coreutils}/bin/tail:/usr/sbin/ip=${iproute2}/bin/ip:/usr/sbin/pppd=${ppp}/bin/pppd
mkdir -p "$out/bin/"
diff --git a/krebs/5pkgs/simple/ftb/default.nix b/krebs/5pkgs/simple/ftb/default.nix
index 8007eaa52..1509961cd 100644
--- a/krebs/5pkgs/simple/ftb/default.nix
+++ b/krebs/5pkgs/simple/ftb/default.nix
@@ -1,7 +1,7 @@
{ fetchurl, lib, stdenv
-, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
+, jre, xorg
, openjdk
-, mesa_glu, openal
+, libGLU, openal
, useAlsa ? false, alsaOss ? null }:
with lib;
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
#!${stdenv.shell}
export _JAVA_AWT_WM_NONREPARENTING=1
- export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm mesa_glu openal ]}
+ export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${makeLibraryPath [ xorg.libX11 xorg.libXext xorg.libXcursor xorg.libXrandr xorg.libXxf86vm libGLU openal ]}
${if useAlsa then "${alsaOss}/bin/aoss" else "" } \
${jre}/bin/java -jar $out/ftb.jar
EOF
diff --git a/krebs/5pkgs/simple/games-user-env/default.nix b/krebs/5pkgs/simple/games-user-env/default.nix
deleted file mode 100644
index abe770ed1..000000000
--- a/krebs/5pkgs/simple/games-user-env/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib, pkgs, ... }: let
-
-#TODO: make sure env exists prior to running
-env_nix = pkgs.writeText "env.nix" ''
- { pkgs ? import <nixpkgs> {} }:
-
- (pkgs.buildFHSUserEnv {
- name = "simple-x11-env";
- targetPkgs = pkgs: with pkgs; [
- coreutils
- ];
- multiPkgs = pkgs: with pkgs; [
- alsaLib
- zlib
- xorg.libXxf86vm
- curl
- openal
- openssl_1_0_2
- xorg.libXext
- xorg.libX11
- xorg.libXrandr
- xorg.libXcursor
- xorg.libXinerama
- xorg.libXi
- mesa_glu
- ];
- runScript = "bash";
- }).env
-'';
-
-
-in pkgs.writeDashBin "games-user-env" ''
- nix-shell ${env_nix}
-''
diff --git a/krebs/5pkgs/simple/generate-secrets/default.nix b/krebs/5pkgs/simple/generate-secrets/default.nix
deleted file mode 100644
index 8522b5dda..000000000
--- a/krebs/5pkgs/simple/generate-secrets/default.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{ pkgs }:
-pkgs.writers.writeDashBin "generate-secrets" ''
- set -eu
- HOSTNAME="$1"
- TMPDIR=$(${pkgs.coreutils}/bin/mktemp -d)
- cd $TMPDIR
-
- PASSWORD=$(${pkgs.pwgen}/bin/pwgen 25 1)
- HASHED_PASSWORD=$(echo $PASSWORD | ${pkgs.hashPassword}/bin/hashPassword -s) > /dev/null
-
- ${pkgs.openssh}/bin/ssh-keygen -t ed25519 -f $TMPDIR/ssh.id_ed25519 -P "" -C "" >/dev/null
- ${pkgs.tinc_pre}/bin/tinc --config "$TMPDIR" generate-keys 4096 >/dev/null
- cat <<EOF > $TMPDIR/hashedPasswords.nix
- {
- root = "$HASHED_PASSWORD";
- }
- EOF
-
- for x in *; do
- ${pkgs.coreutils}/bin/cat $x | ${pkgs.brain}/bin/brain insert -m krebs-secrets/$HOSTNAME/$x > /dev/null
- done
- echo $PASSWORD | ${pkgs.brain}/bin/brain insert -m hosts/$HOSTNAME/root > /dev/null
-
- cat <<EOF
- $HOSTNAME = {
- owner = config.krebs.users.krebs;
- nets = {
- retiolum = {
- ip4.addr = "10.243.0.changeme";
- ip6.addr = "42:0:0:0:0:0:0:changeme";
- aliases = [
- "$HOSTNAME.r"
- ];
- tinc = {
- pubkey = ${"''"}
- $(cat $TMPDIR/rsa_key.pub)
- ${"''"};
- pubkey_ed25519 = "$(cut -d ' ' -f 3 $TMPDIR/ed25519_key.pub)";
- };
- };
- };
- ssh.privkey.path = "\''${config.krebs.secret.directory}/ssh.id_ed25519";
- ssh.pubkey = "$(cat $TMPDIR/ssh.id_ed25519.pub)";
- };
- EOF
-
- rm -rf $TMPDIR
-''
-
diff --git a/krebs/5pkgs/simple/git-hooks/default.nix b/krebs/5pkgs/simple/git-hooks/default.nix
index 3ec43739c..fe159c833 100644
--- a/krebs/5pkgs/simple/git-hooks/default.nix
+++ b/krebs/5pkgs/simple/git-hooks/default.nix
@@ -1,5 +1,7 @@
-{ pkgs, stockholm, ... }:
-
+{ pkgs, lib, ... }:
+let
+ stockholm.lib = import ../../../../lib/pure.nix { inherit lib; };
+in
with stockholm.lib;
{
@@ -112,6 +114,7 @@ with stockholm.lib;
git diff --stat $id2..$id \
| sed '$!s/\(+*\)\(-*\)$/'$(green '\1')$(red '\2')'/'
)"
+ echo "$(red "$message")"
''}
done
diff --git a/krebs/5pkgs/simple/gitignore.nix b/krebs/5pkgs/simple/gitignore.nix
deleted file mode 100644
index b3c750a08..000000000
--- a/krebs/5pkgs/simple/gitignore.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-{ pkgs }:
-
-/* gitignore - Filter for intentionally untracked lines or blocks of code
-
-This is a filter that allows specifying intentionally untracked lines and
-blocks of code that Git should ignore.
-
-Example:
-
- int main(void) {
- printf("I would never say derp.\n");
- //#gitignore-begin
- printf("DERP!\n");
- //#gitignore-end
- printf("DERP!\n"); //#gitignore
- return 0;
- }
-
-Installation:
-
- Define a filter, e.g. in ~/.config/git/config[1]:
-
- [filter "gitignore"]
- clean = gitignore
- smudge = cat
-
- Assing that filter to some paths, e.g. in ~/.config/git/attributes[2]:
-
- *.hs filter=gitignore
- *.c filter=gitignore
- ...
-
- [1]: For more information about defining filters see git-config(1).
- [2]: For more information about assigning filters see gitattributes(5).
-*/
-
-pkgs.execBin "gitignore" {
- filename = "${pkgs.gnused}/bin/sed";
- argv = [
- "gitignore"
- /* sed */ ''
- /#gitignore-begin/,/#gitignore-end/d
- /#gitignore/d
- ''
- ];
-}
diff --git a/krebs/5pkgs/simple/gnokii/default.nix b/krebs/5pkgs/simple/gnokii/default.nix
index 995de3468..c11a6be6d 100644
--- a/krebs/5pkgs/simple/gnokii/default.nix
+++ b/krebs/5pkgs/simple/gnokii/default.nix
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, intltool, perl, gettext, libusb-compat-0_1, pkg-config, bluez
-, readline, pcsclite, libical, gtk2, glib, libXpm
+, readline, pcsclite, libical, gtk2, glib, libxpm
, fetchpatch
}:
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
buildInputs = [
perl intltool gettext libusb-compat-0_1
glib gtk2 pkg-config bluez readline
- libXpm pcsclite libical
+ libxpm pcsclite libical
];
meta = {
diff --git a/krebs/5pkgs/simple/goify/default.nix b/krebs/5pkgs/simple/goify/default.nix
index 9c44aaeeb..7cc3d1b86 100644
--- a/krebs/5pkgs/simple/goify/default.nix
+++ b/krebs/5pkgs/simple/goify/default.nix
@@ -1,6 +1,6 @@
-{ pkgs, ... }:
+{ pkgs, writeBashBin, ... }:
-pkgs.writeBashBin "goify" ''
+writeBashBin "goify" ''
set -euf
GO_HOST=''${GO_HOST:-go}
diff --git a/krebs/5pkgs/simple/hashPassword/default.nix b/krebs/5pkgs/simple/hashPassword/default.nix
deleted file mode 100644
index 8d3ba2525..000000000
--- a/krebs/5pkgs/simple/hashPassword/default.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{ lib, pkgs, ... }:
-
-pkgs.writers.writeDashBin "hashPassword" ''
- # usage: hashPassword [...]
- set -euf
-
- export PATH=${lib.makeBinPath (with pkgs; [
- coreutils
- mkpasswd
- openssl
- ])}
-
- salt=$(openssl rand -base64 16 | tr -d '+=' | head -c 16)
- exec mkpasswd -m sha-512 -S "$salt" "$@"
-''
diff --git a/krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur b/krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur
index 696d1c00d..bdfb3eb61 100644
--- a/krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur
+++ b/krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur
@@ -1,3 +1,4 @@
+# TODO dedup with paste
find_item() {
if test ${#1} -ge 7; then
set -- "$(find "$STATEDIR/items" -mindepth 1 -maxdepth 1 \
@@ -58,6 +59,9 @@ read_uri() {
$uri |
capture("^((?<scheme>[^:]*):)?(//(?<authority>[^/]*))?(?<path>[^?#]*)([?](?<query>[^#]*))?([#](?<fragment>.*))?$") |
. + {
+ #authority: (.authority | if . != null then
+ # capture("^((?<userinfo>[^@]*)@)?(?<host>[^:]*)(:(?<port>.*))?$")
+ #else . end),
query: (.query | if . != null then
split("&") |
map(split("=") | {key:.[0],value:.[1]}) |
@@ -141,26 +145,26 @@ case "$Method $path" in
description: $uri.query.description,
datetime: now,
type: $info["MIME type"],
- animated: false,
+ animated: false, # TODO
width: $info.width,
height: $info.height,
size: $info.size,
- views: 0,
- bandwidth: 0,
- vote: null,
- favorite: false,
- nsfw: null,
- section: null,
- account_url: null,
- acount_id: 0,
- is_ad: false,
- is_most_viral: false,
- tags: [],
- ad_type: 0,
- ad_url: "",
- in_gallery: false,
+ views: 0, # TODO
+ bandwidth: 0, # TODO
+ vote: null, # TODO
+ favorite: false, # TODO
+ nsfw: null, # TODO
+ section: null, # TODO
+ account_url: null, # TODO
+ acount_id: 0, # TODO
+ is_ad: false, # TODO
+ is_most_viral: false, # TODO
+ tags: [], # TODO
+ ad_type: 0, # TODO
+ ad_url: "", # TODO
+ in_gallery: false, # TODO
deletehash: @uri "\($id)?deletehash=\($deletehash)",
- name: "",
+ name: "", # TODO
link: $link,
}
')
diff --git a/krebs/5pkgs/simple/htgen/default.nix b/krebs/5pkgs/simple/htgen/default.nix
index 1ee13783b..945801bfe 100644
--- a/krebs/5pkgs/simple/htgen/default.nix
+++ b/krebs/5pkgs/simple/htgen/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p $out/bin
{
- echo '#! ${pkgs.dash}/bin/dash'
+ echo '#! ${pkgs.busybox}/bin/sh'
echo 'export PATH=${lib.makeBinPath [
pkgs.coreutils
pkgs.jq
diff --git a/krebs/5pkgs/simple/internetarchive/default.nix b/krebs/5pkgs/simple/internetarchive/default.nix
deleted file mode 100644
index dfe93befd..000000000
--- a/krebs/5pkgs/simple/internetarchive/default.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ lib, pkgs, stdenv, pkgs }:
-with pkgs.python3Packages;
-buildPythonPackage rec {
- pname = "internetarchive";
- version = "1.7.3";
- name = "${pname}-${version}";
-
- src = fetchPypi {
- inherit pname version;
- sha256 = "0x3saklabdx7qrr11h5bjfd75hfbih7pw5gvl2784zvvvrqrz45g";
- };
-
- propagatedBuildInputs = [
- requests
- jsonpatch
- docopt
- clint
- six
- schema
- backports_csv
- ];
-
- # check only works when cloned from git repo
- doCheck = false;
-
- checkInputs = [
- pytest
- responses
- ];
-
- prePatch = ''
- sed -i "s/'schema.*'/'schema>=0.4.0'/" setup.py
- '';
-
- meta = with lib; {
- description = "python library and cli for uploading files to internet archive";
- license = licenses.agpl3;
- };
-}
diff --git a/krebs/5pkgs/simple/irc-announce/default.nix b/krebs/5pkgs/simple/irc-announce/default.nix
index 75036d41c..d5eae30c5 100644
--- a/krebs/5pkgs/simple/irc-announce/default.nix
+++ b/krebs/5pkgs/simple/irc-announce/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, ... }:
+{ pkgs, ircaids, ... }:
pkgs.writers.writeDashBin "irc-announce" ''
set -euf
@@ -15,7 +15,7 @@ pkgs.writers.writeDashBin "irc-announce" ''
fi
printf %s "$message" |
- ${pkgs.ircaids}/bin/ircsink \
+ ${ircaids}/bin/ircsink \
--nick="$IRC_NICK" \
--port="$IRC_PORT" \
--server="$IRC_SERVER" \
diff --git a/krebs/5pkgs/simple/krebspaste/default.nix b/krebs/5pkgs/simple/krebspaste/default.nix
deleted file mode 100644
index d97b6a053..000000000
--- a/krebs/5pkgs/simple/krebspaste/default.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ bepasty-client-cli, gnused, writeDashBin }:
-
-writeDashBin "krebspaste" ''
- ${bepasty-client-cli}/bin/bepasty-cli -L 1m --url http://paste.r "$@" |
- ${gnused}/bin/sed '
- $ {
- s/$/\/+inline/
- p
- s/\<r\>/krebsco.de/
- }
- '
-''
diff --git a/krebs/5pkgs/simple/logf/default.nix b/krebs/5pkgs/simple/logf/default.nix
deleted file mode 100644
index 36a7fed2f..000000000
--- a/krebs/5pkgs/simple/logf/default.nix
+++ /dev/null
@@ -1,112 +0,0 @@
-{ lib, pkgs, ... }:
-
-let
- default-host-colors = pkgs.writeJSON "logf.default-host-colors.json" {
- };
- default-prio-colors = pkgs.writeJSON "logf.default-prio-colors.json" {
- "0" = 196; # emerg
- "1" = 160; # alert
- "2" = 124; # crit
- "3" = 009; # err
- "4" = 011; # warning
- "5" = 255; # notice
- "6" = 250; # info
- "7" = 139; # debug
- "-" = 005; # undefined priority
- };
- default-urgent = pkgs.writeJSON "logf.default-urgent.json" [
- ];
-in
-
-pkgs.writeDashBin "logf" ''
- export LOGF_HOST_COLORS LOGF_PRIO_COLORS LOGF_URGENT
- LOGF_HOST_COLORS=$(cat "''${LOGF_HOST_COLORS-${default-host-colors}}")
- LOGF_PRIO_COLORS=$(cat "''${LOGF_PRIO_COLORS-${default-prio-colors}}")
- LOGF_URGENT=$(cat "''${LOGF_URGENT-${default-urgent}}")
- printf '%s\0' "$@" \
- | ${pkgs.findutils}/bin/xargs -0 -P 0 -n 1 ${pkgs.writeDash "logf-remote" ''
- target=$1
- target_host=$(echo "$1" | sed 's/^.*@//;s/\..*//')
- exec 3>&1
- 2>&1 1>&3 ssh "$target" -T \
- -o PreferredAuthentications=publickey \
- -o StrictHostKeyChecking=yes \
- exec journalctl -af -n 0 -o json \
- | stdbuf -oL jq -Rcf ${pkgs.writeJq "logf-remote-error.jq" ''
- {
- PRIORITY: "4",
- MESSAGE: .,
- SYSLOG_IDENTIFIER: env.target_host,
- }
- ''}
- sleep 10m
- exec "$0" "$@"
- ''} \
- | ${pkgs.jq}/bin/jq -Rrf ${pkgs.writeJq "logf-filter.jq" ''
- (env.LOGF_HOST_COLORS | fromjson) as $host_colors |
- (env.LOGF_PRIO_COLORS | fromjson) as $prio_colors |
- (env.LOGF_URGENT | fromjson | map("(\(.))") | join("|"))
- as $urgent_regex |
-
- def when(c; f): if c then f else . end;
-
- # anaphoric gsub
- def agsub(re; f):
- # Don't try empty regex: https://github.com/stedolan/jq/issues/1206
- when(re != ""; gsub("(?<it>\(re))"; .it | f));
-
- # :: [int] -> sgr
- def sgr: "\u001b[\(map(tostring) | join(";"))m";
-
- # :: sgr
- def rst: [] | sgr;
-
- # :: int -> sgr
- def fg(i): [38,5,i]|sgr;
- # TODO def fg(r;g;b): [38,2,r,g,b]|sgr;
- # http://cvs.schmorp.de/rxvt-unicode/src/command.C?revision=1.570&view=markup&sortby=log&sortdir=down
-
- # (sgr; sgr) | (null; any) :: str -> str
- def col(a; b): when(a != null; a + . + b);
- def col(a): col(a; rst);
-
-
- def p_time:
- ._SOURCE_REALTIME_TIMESTAMP
- | if . != null then . | fromjson | . / 1000000 else now end
- | gmtime
- | todateiso8601
- | col(fg(237));
-
- def p_host:
- ._HOSTNAME
- | if . != null then . else "-" end
- | col($host_colors[.]|when(. != null; fg(.)));
-
- def p_ident:
- if .SYSLOG_IDENTIFIER != null then .SYSLOG_IDENTIFIER
- else ._COMM end
- | col(fg(244));
-
- def p_message:
- fg($prio_colors[if has("PRIORITY") then .PRIORITY else "-" end])
- as $prio_c |
- .MESSAGE
- | sub("\r$"; "")
- | agsub($urgent_regex; "\(.)\u0007" | col(fg(219); $prio_c))
- | col($prio_c);
-
- try fromjson catch {
- _SOURCE_REALTIME_TIMESTAMP: now | tostring | sub("[.]"; ""),
- SYSLOG_IDENTIFIER: "logf/journalctl",
- MESSAGE: .,
- } |
-
- [ p_time
- , p_host
- , p_ident
- , p_message
- ]
- | join(" ")
- ''}
-''
diff --git a/krebs/5pkgs/simple/netcup/default.nix b/krebs/5pkgs/simple/netcup/default.nix
deleted file mode 100644
index 750e9cfa9..000000000
--- a/krebs/5pkgs/simple/netcup/default.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ coreutils, curl, fetchgit, gawk, gnugrep, gnused, jq, stdenv, stockholm, w3m, ... }:
-with stockholm.lib;
-
-let
- readJSON = path: fromJSON (readFile path);
- sed.escape = replaceStrings ["/"] ["\\/"]; # close enough
- PATH = makeBinPath [
- coreutils
- curl
- gawk
- gnugrep
- gnused
- jq
- w3m
- ];
-in
-stdenv.mkDerivation {
- name = "netcup-1.0.0";
- src = fetchgit {
- url = "http://cgit.ni.krebsco.de/netcup";
- rev = "refs/tags/v1.0.0";
- sha256 = "1rn7bncfhjw0bqjbvj38m7lks4nyf5qcvkj9dg0zr99ba6dylzx5";
- };
- phases = [ "unpackPhase" "patchPhase" "installPhase" ];
- patchPhase = ''
- path=${shell.escape (sed.escape PATH)}
- sed -i "1s/.*/&\nPATH=$path/" vcp
- '';
- installPhase = ''
- mkdir -p $out/bin
- cp vcp $out/bin
- '';
-}
diff --git a/krebs/5pkgs/simple/nixos-format-error.nix b/krebs/5pkgs/simple/nixos-format-error.nix
deleted file mode 100644
index a28f7245f..000000000
--- a/krebs/5pkgs/simple/nixos-format-error.nix
+++ /dev/null
@@ -1,107 +0,0 @@
-{ pkgs }:
-
-pkgs.writeGawkBin "nixos-format-error" ''
- # usage: nixos-rebuild ... 2>&1 | nixos-format-error
-
- function out() {
- print
- next
- }
-
- BEGIN {
- IDLE = 0
- ACTIVE = 1
- PASSIVE = 2
- ERROR = 3
-
- start_state = IDLE
-
- state = start_state
- }
-
- END {
- if (trace_count)
- for (i = trace_count - 1; i >= 0; i--)
- print trace[i]
- }
-
- state == PASSIVE {
- out()
- }
-
- state == IDLE {
- if ($0 ~ /^building the system configuration\.\.\. ?$/) {
- state = ACTIVE
- }
- out()
- }
-
- state == ACTIVE {
- if ($1 ~ /(\[[0-9;]+m)?error:(\[[0-9;]m)?/) {
- state = ERROR
- sub(/^/,"\x1b[31;1m"); sub(/$/,"\x1b[m")
- trace[trace_count++] = $0
-
- "stty -F /dev/tty size" |& getline
- COLUMNS = gensub(/.* ([0-9]+)$/, "\\1", "1")
-
- next
- }
- if ($0 ~ /^these [0-9]+ derivations will be built:/) {
- state = PASSIVE
- }
- if ($0 == "activating the configuration...") {
- state = PASSIVE
- }
- out()
- }
-
- state == ERROR {
- sub(/ $/, "")
- gsub(/\[[0-9;]*m/, "")
-
- if ($0 ~ /^\s*at /) {
- location = gensub(/^\s*at (.*):$/,"\\1","1")
- content = ""
- lnumcol = gensub(/^.*:([0-9]+:[0-9]+)$/,"\\1","1",location)
- lnum = gensub(/:.*/,"","1",lnumcol)
- col = gensub(/.*:/,"","1",lnumcol)
- next
- }
-
- if ($1 == lnum "|") {
- content = gensub(/^\s*[0-9]+\|(.*)/,"\\1","1")
-
- location = sprintf("%50s", location)
-
- preview_size = COLUMNS - length(location " ")
-
- prefix = gensub(/^\s*/,"","1",substr(content, 1, col))
- infix = gensub(/^([0-9a-zA-Z]+|.).*$/, "\\1", "1", substr(content, col + 1))
- suffix = substr(content, col + length(infix) + 1)
-
- if (length(prefix infix suffix) > preview_size) {
- n = (preview_size - length(infix)) / 2 - length(" ")
- prefix = substr(prefix, length(prefix) - n + 1)
- if (prefix != "") { prefix = "…" prefix }
- suffix = substr(suffix, 1, n)
- if (suffix != "") { suffix = suffix "…" }
- }
-
- preview = \
- "\x1b[38;5;244m" prefix "\x1b[m" \
- "\x1b[38;5;230m" infix "\x1b[m" \
- "\x1b[38;5;244m" suffix "\x1b[m"
-
- trace[trace_count++] = location " " preview
- next
- }
-
- if ($0 == "") next
- if ($0 ~ /^\s*… (from|while)/) next
- if ($0 ~ /^\s*([0-9]*)\|/) next
-
- trace[trace_count++] = $0
- next
- }
-''
diff --git a/krebs/5pkgs/simple/ovh-zone/default.nix b/krebs/5pkgs/simple/ovh-zone/default.nix
index bc0e45cb9..a31611ea2 100644
--- a/krebs/5pkgs/simple/ovh-zone/default.nix
+++ b/krebs/5pkgs/simple/ovh-zone/default.nix
@@ -6,9 +6,11 @@
## diff future.sorted current.sorted
python3Packages.buildPythonPackage rec {
- name = "ovh-zone-${version}";
+ pname = "ovh-zone";
version = "0.4.4";
- propagatedBuildInputs = with pkgs.python3Packages;[
+ pyproject = true;
+ build-system = [ python3Packages.setuptools ];
+ dependencies = with pkgs.python3Packages;[
ovh
docopt
];
diff --git a/krebs/5pkgs/simple/python-dnsstamps.nix b/krebs/5pkgs/simple/python-dnsstamps.nix
index 18d08fec8..314e11610 100644
--- a/krebs/5pkgs/simple/python-dnsstamps.nix
+++ b/krebs/5pkgs/simple/python-dnsstamps.nix
@@ -3,6 +3,8 @@
python3Packages.buildPythonPackage rec {
pname = "dnsstamps";
version = "1.3.0";
+ pyproject = true;
+ build-system = [ python3Packages.setuptools ];
src = python3Packages.fetchPypi {
inherit pname version;
diff --git a/krebs/5pkgs/simple/qrscan.nix b/krebs/5pkgs/simple/qrscan.nix
deleted file mode 100644
index df9a98053..000000000
--- a/krebs/5pkgs/simple/qrscan.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ pkgs }:
-
-pkgs.writeDashBin "qrscan" ''
- set -efu
-
- ${pkgs.zbar}/bin/zbarcam -1 | ${pkgs.gnused}/bin/sed -n 's/^QR-Code://p'
-''
diff --git a/krebs/5pkgs/simple/reaktor2-plugins.nix b/krebs/5pkgs/simple/reaktor2-plugins/default.nix
index 5b7be5d33..73c46755f 100644
--- a/krebs/5pkgs/simple/reaktor2-plugins.nix
+++ b/krebs/5pkgs/simple/reaktor2-plugins/default.nix
@@ -15,7 +15,7 @@ with stockholm.lib;
commands = {
random-emoji = {
- filename = stockholm.outPath + "/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh";
+ filename = ./scripts/random-emoji.sh;
env = {
PATH = makeBinPath (with pkgs; [ coreutils gnused gnugrep xmlstarlet wget ]);
};
@@ -35,10 +35,10 @@ with stockholm.lib;
};
stockholm-issue = {
- filename = stockholm.outPath + "/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh";
+ filename = ./scripts/random-issue.sh;
env = {
PATH = makeBinPath (with pkgs; [ coreutils git gnused haskellPackages.lentil ]);
- origin = "http://cgit.gum/stockholm";
+ origin = "https://cgit.krebsco.de/stockholm";
state_dir = "/tmp/stockholm-issue";
};
};
@@ -59,7 +59,7 @@ with stockholm.lib;
filename = pkgs.writers.writeDash "sed-plugin" ''
set -efu
exec ${pkgs.python3}/bin/python \
- ${./Reaktor/scripts/sed-plugin.py} "$@"
+ ${./scripts/sed-plugin.py} "$@"
'';
};
};
@@ -68,7 +68,7 @@ with stockholm.lib;
activate = "match";
pattern = "^(.*Shack.*)$";
arguments = [1];
- command.filename = stockholm.outPath + "/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh";
+ command.filename = ./scripts/shack-correct.sh;
};
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh b/krebs/5pkgs/simple/reaktor2-plugins/scripts/random-emoji.sh
index 6f3dd4a3f..6f3dd4a3f 100755
--- a/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh
+++ b/krebs/5pkgs/simple/reaktor2-plugins/scripts/random-emoji.sh
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh b/krebs/5pkgs/simple/reaktor2-plugins/scripts/random-issue.sh
index 5c47c6156..5c47c6156 100755
--- a/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh
+++ b/krebs/5pkgs/simple/reaktor2-plugins/scripts/random-issue.sh
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py b/krebs/5pkgs/simple/reaktor2-plugins/scripts/sed-plugin.py
index 4925b25bb..4925b25bb 100755
--- a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py
+++ b/krebs/5pkgs/simple/reaktor2-plugins/scripts/sed-plugin.py
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh b/krebs/5pkgs/simple/reaktor2-plugins/scripts/shack-correct.sh
index d500b3cb3..d500b3cb3 100755
--- a/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh
+++ b/krebs/5pkgs/simple/reaktor2-plugins/scripts/shack-correct.sh
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/tell-on_join.sh b/krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_join.sh
index 6978e38c6..6978e38c6 100755
--- a/krebs/5pkgs/simple/Reaktor/scripts/tell-on_join.sh
+++ b/krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_join.sh
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/tell-on_privmsg.sh b/krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh
index fc05bdefb..fc05bdefb 100755
--- a/krebs/5pkgs/simple/Reaktor/scripts/tell-on_privmsg.sh
+++ b/krebs/5pkgs/simple/reaktor2-plugins/scripts/tell-on_privmsg.sh
diff --git a/krebs/5pkgs/simple/realwallpaper/default.nix b/krebs/5pkgs/simple/realwallpaper/default.nix
index 5364a37dc..44e888879 100644
--- a/krebs/5pkgs/simple/realwallpaper/default.nix
+++ b/krebs/5pkgs/simple/realwallpaper/default.nix
@@ -1,8 +1,10 @@
-{ pkgs, ... }:
+{ pkgs, nomads-cloud, ... }:
pkgs.writers.writeDashBin "generate-wallpaper" ''
set -euf
- export PATH=${with pkgs; lib.makeBinPath [
+ export PATH=${pkgs.lib.makeBinPath ([
+ nomads-cloud
+ ] ++ (with pkgs; [
coreutils
curl
gnugrep
@@ -12,9 +14,8 @@ pkgs.writers.writeDashBin "generate-wallpaper" ''
imagemagick
inkscape
jq
- nomads-cloud
xplanet
- ]}
+ ]))}
# usage: getimg FILENAME URL
fetch() {
diff --git a/krebs/5pkgs/simple/repo-sync/default.nix b/krebs/5pkgs/simple/repo-sync/default.nix
index 66f220ba6..1c88c2e91 100644
--- a/krebs/5pkgs/simple/repo-sync/default.nix
+++ b/krebs/5pkgs/simple/repo-sync/default.nix
@@ -2,17 +2,19 @@
with python3Packages; buildPythonPackage rec {
name = "repo-sync-${version}";
- version = "0.2.7";
+ version = "1.0.0";
+ pyproject = true;
+ build-system = [ python3Packages.setuptools ];
propagatedBuildInputs = [
docopt
- GitPython
+ gitpython
pkgs.git
];
src = fetchFromGitHub {
owner = "krebs";
repo = "repo-sync";
rev = version;
- sha256 = "1qjf1jmxf7xzwskybdys4vqncnwj9f3xwk1gv354zrla68s533cw";
+ hash = "sha256-dkhPUaCL+tZn5rF7NN8A6NK/0tz669dLLYRGtRxO+fM=";
};
meta = {
homepage = http://github.com/makefu/repo-sync;
diff --git a/krebs/5pkgs/simple/ssh-audit.nix b/krebs/5pkgs/simple/ssh-audit.nix
index 4574eb644..286282107 100644
--- a/krebs/5pkgs/simple/ssh-audit.nix
+++ b/krebs/5pkgs/simple/ssh-audit.nix
@@ -4,6 +4,8 @@ python3Packages.buildPythonPackage rec {
inherit (meta) version;
pname = "ssh-audit";
+ pyproject = true;
+ build-system = [ python3Packages.setuptools ];
src = fetchFromGitHub {
owner = "arthepsy";
diff --git a/krebs/5pkgs/simple/tinc_graphs/default.nix b/krebs/5pkgs/simple/tinc_graphs/default.nix
index 953804dd0..11079a9a3 100644
--- a/krebs/5pkgs/simple/tinc_graphs/default.nix
+++ b/krebs/5pkgs/simple/tinc_graphs/default.nix
@@ -1,10 +1,12 @@
{ fetchFromGitHub, lib, pkgs, python3Packages, stdenv }:
python3Packages.buildPythonPackage rec {
- name = "tinc_graphs-${version}";
+ pname = "tinc_graphs";
version = "0.4.0";
+ pyproject = true;
+ build-system = [ python3Packages.setuptools ];
- propagatedBuildInputs = with pkgs;[
+ dependencies = with pkgs;[
python3Packages.pygeoip
## ${geolite-legacy}/share/GeoIP/GeoIPCity.dat
];
diff --git a/krebs/5pkgs/simple/treq/default.nix b/krebs/5pkgs/simple/treq/default.nix
index 7cb826a51..8689479b3 100644
--- a/krebs/5pkgs/simple/treq/default.nix
+++ b/krebs/5pkgs/simple/treq/default.nix
@@ -1,14 +1,16 @@
-{ stdenv, fetchurl, pythonPackages }:
+{ stdenv, fetchurl, python3Packages }:
-pythonPackages.buildPythonPackage rec {
+python3Packages.buildPythonPackage rec {
name = "${pname}-${version}";
pname = "treq";
version = "15.1.0";
+ pyproject = true;
+ build-system = [ python3Packages.setuptools ];
src = fetchurl {
url = "mirror://pypi/t/${pname}/${name}.tar.gz";
sha256= "425a47d5d52a993d51211028fb6ade252e5fbea094e878bb4b644096a7322de8";
};
- propagatedBuildInputs = with pythonPackages; [
+ propagatedBuildInputs = with python3Packages; [
twisted
pyopenssl
requests
diff --git a/krebs/5pkgs/simple/ukrepl.nix b/krebs/5pkgs/simple/ukrepl.nix
index bdea4181f..da1c05c92 100644
--- a/krebs/5pkgs/simple/ukrepl.nix
+++ b/krebs/5pkgs/simple/ukrepl.nix
@@ -1,5 +1,5 @@
-{ lib, pkgs,stdenv }:
-let
+{ lib, pkgs, stdenv }:
+let
src = pkgs.fetchFromGitHub {
owner = "makefu";
repo = "ukrepl";
@@ -7,5 +7,5 @@ let
hash = "sha256:1lnhkf02f18fvf3l2fcszvs4x115lql17akabd5ph9ff9z33k8rv";
};
in
- pkgs.writers.writePython3Bin "ukrepl" {} (builtins.readFile (src + "/ukrepl"))
+ pkgs.writers.writePython3Bin "ukrepl" {} (src + "/ukrepl")
diff --git a/krebs/5pkgs/simple/untilport/default.nix b/krebs/5pkgs/simple/untilport/default.nix
index 2930fd1eb..d299ec807 100644
--- a/krebs/5pkgs/simple/untilport/default.nix
+++ b/krebs/5pkgs/simple/untilport/default.nix
@@ -1,6 +1,6 @@
-{ pkgs, ... }:
+{ libressl, writeDashBin, ... }:
-pkgs.writeDashBin "untilport" ''
+writeDashBin "untilport" ''
set -euf
usage() {
@@ -13,6 +13,6 @@ pkgs.writeDashBin "untilport" ''
if [ $# -ne 2 ]; then
usage
else
- until ${pkgs.libressl.nc}/bin/nc -z "$@"; do sleep 1; done
+ until ${libressl.nc}/bin/nc -z "$@"; do sleep 1; done
fi
''
diff --git a/krebs/5pkgs/simple/urix.nix b/krebs/5pkgs/simple/urix.nix
index 73ea3e665..9ac3a115c 100644
--- a/krebs/5pkgs/simple/urix.nix
+++ b/krebs/5pkgs/simple/urix.nix
@@ -1,14 +1,13 @@
-{ pkgs, stockholm }:
+{ pkgs, lib, writeDash }:
+
+let
+ stockholm.lib = import ../../../lib/pure.nix { inherit lib; };
+in
# urix - URI eXtractor
# Extract all the URIs from standard input and write them to standard output!
# usage: urix < SOMEFILE
-pkgs.execBin "urix" {
- filename = "${pkgs.gnugrep}/bin/grep";
- argv = [
- "urix"
- "-Eo"
- "\\b${stockholm.lib.uri.posix-extended-regex}\\b"
- ];
-}
+writeDash "urix" ''
+ exec ${pkgs.gnugrep}/bin/grep -Eo '\b${stockholm.lib.uri.posix-extended-regex}\b'
+''
diff --git a/krebs/5pkgs/simple/with-tmpdir/default.nix b/krebs/5pkgs/simple/with-tmpdir/default.nix
deleted file mode 100644
index 9862671f8..000000000
--- a/krebs/5pkgs/simple/with-tmpdir/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, fetchgit, coreutils, dash, ... }:
-
-stdenv.mkDerivation {
- name = "with-tmpdir-1";
-
- src = fetchgit {
- url = http://cgit.ni.krebsco.de/with-tmpdir;
- rev = "3243c02ed8cd27a04c080bd39560204980f6c16a";
- sha256 = "80ee6cafb2c337999ddcd1e41747d6256b7cfcea605358c2046eb7e3729555c6";
- };
-
- phases = [
- "unpackPhase"
- "installPhase"
- ];
-
- installPhase = ''
- mkdir -p $out/bin
-
- { echo '#! ${dash}/bin/dash'
- echo 'OLDPATH=$PATH'
- echo 'PATH=${coreutils}/bin'
- sed '$s/^/#/' ./with-tmpdir
- echo '(PATH=$OLDPATH; exec "$@")'
- } > $out/bin/with-tmpdir
-
- chmod +x $out/bin/with-tmpdir
- '';
-}