From e97a29678c097a9ea43bac340bec3fd3226001b5 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 31 Aug 2021 19:48:19 +0200 Subject: tv elm-package-proxy: add search.json --- tv/2configs/elm-packages-proxy.nix | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/tv/2configs/elm-packages-proxy.nix b/tv/2configs/elm-packages-proxy.nix index 097d706c6..265289bbf 100644 --- a/tv/2configs/elm-packages-proxy.nix +++ b/tv/2configs/elm-packages-proxy.nix @@ -60,6 +60,11 @@ in { proxy_pass $new_uri; ''; + + locations."/search.json".extraConfig = '' + proxy_pass http://127.0.0.1:${toString config.krebs.htgen.elm-packages-proxy.port}; + proxy_pass_header Server; + ''; }; krebs.htgen.elm-packages-proxy = { @@ -245,6 +250,76 @@ in { } | jq -cs add > $response + file_response 200 OK "$response" 'application/json; charset=UTF-8' + exit + ;; + 'GET /search.json') + + searchjson=$HOME/cache/search.json + mkdir -p "$HOME/cache" + + # update cached search.json + ( + last_modified=$( + if test -f "$searchjson"; then + date -Rr "$searchjson" + else + date -R -d @0 + fi + ) + tempsearchjson=$(mktemp "$searchjson.XXXXXXXX") + trap 'rm "$tempsearchjson" >&2' EXIT + curl -fsS --compressed https://package.elm-lang.org/search.json \ + -H "If-Modified-Since: $last_modified" \ + -o "$tempsearchjson" + if test -s "$tempsearchjson"; then + mv "$tempsearchjson" "$searchjson" + trap - EXIT + fi + ) + + response=$(mktemp -t htgen.$$.elm-packages-proxy.search.XXXXXXXX) + trap 'rm "$response" >&2' EXIT + + { + printf '{"upstream":'; cat "$searchjson" + printf ',"private":'; (cd ${cfg.packageDir}; find -mindepth 3 -maxdepth 3) | + jq -Rs ' + split("\n") | + map( + select(.!="") | + match("^\\./(?[^/]+)/(?[^/]+)/(?[^/]+)$").captures | + map({key:.name,value:.string}) | + from_entries + ) | + map({ + key: "\(.author)/\(.pname)", + value: .version, + }) | + from_entries + ' + printf '}' + } | + jq -c ' + reduce .upstream[] as $upstreamItem ({ private, output: [] }; + .private[$upstreamItem.name] as $privateItem | + if $privateItem then + .output += [$upstreamItem * { version: $privateItem.version }] | + .private |= del(.[$upstreamItem.name]) + else + .output += [$upstreamItem] + end + ) | + + .output + (.private | to_entries | sort_by(.key) | map({ + name: .key, + version: .value, + summary: "dummy summary", + license: "dummy license", + })) + ' \ + > $response + file_response 200 OK "$response" 'application/json; charset=UTF-8' exit ;; -- cgit v1.2.3 From 20e358043546482acfa8c6134f095c1a64ef144d Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 31 Aug 2021 20:06:03 +0200 Subject: tv elm-package-proxy: add DELETE --- tv/2configs/elm-packages-proxy.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tv/2configs/elm-packages-proxy.nix b/tv/2configs/elm-packages-proxy.nix index 265289bbf..1df8c7b70 100644 --- a/tv/2configs/elm-packages-proxy.nix +++ b/tv/2configs/elm-packages-proxy.nix @@ -197,6 +197,36 @@ in { exit ;; + 'DELETE /packages/'*) + + author=$req_x_author + pname=$req_x_package + user=$req_x_user + version=$req_x_version + + zipball=${cfg.packageDir}/$author/$pname/$version/zipball + elmjson=$HOME/cache/$author%2F$pname%2F$version%2Felm.json + endpointjson=$HOME/cache/$author%2F$pname%2F$version%2Fendpoint.json + + if test -e "$zipball"; then + zipball_owner=$(attr -q -g X-User "$zipball" || :) + if test "$zipball_owner" = "$req_x_user"; then + echo "user $user is deleting package $author/$pname@$version" >&2 + rm -f "$elmjson" + rm -f "$endpointjson" + rm "$zipball" + string_response 200 OK \ + "package deleted: $author/$pname@$version" \ + text/plain + exit + else + string_response 403 Forbidden \ + "package already exists: $author/$pname@$version" \ + text/plain + exit + fi + fi + ;; 'GET /all-packages'|'POST /all-packages') response=$(mktemp -t htgen.$$.elm-packages-proxy.all-packages.XXXXXXXX) -- cgit v1.2.3 From 63b933cfbe3ab48c2ba89b13e436a1a667b533c7 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Sep 2021 23:07:37 +0200 Subject: tv gitrepos: add ircaids --- tv/2configs/gitrepos.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tv/2configs/gitrepos.nix b/tv/2configs/gitrepos.nix index 1586f3b33..2b8457e40 100644 --- a/tv/2configs/gitrepos.nix +++ b/tv/2configs/gitrepos.nix @@ -83,6 +83,9 @@ let { htgen = { cgit.desc = "toy HTTP server"; }; + ircaids = { + cgit.desc = "Assortment of aids for working with Internet relay chat"; + }; krops = { cgit.desc = "deployment tools"; }; -- cgit v1.2.3 From 72d5a050e11ee59604ae8d165b3a284d2799e7e2 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Oct 2021 22:59:35 +0200 Subject: ircaids: init at 1.0.0 --- krebs/5pkgs/simple/ircaids.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 krebs/5pkgs/simple/ircaids.nix diff --git a/krebs/5pkgs/simple/ircaids.nix b/krebs/5pkgs/simple/ircaids.nix new file mode 100644 index 000000000..566346cc9 --- /dev/null +++ b/krebs/5pkgs/simple/ircaids.nix @@ -0,0 +1,32 @@ +{ lib, pkgs, stdenv }: + +stdenv.mkDerivation rec { + pname = "ircaids"; + version = "1.0.0"; + + src = pkgs.fetchgit { + url = "https://cgit.krebsco.de/ircaids"; + rev = "refs/tags/${version}"; + sha256 = "13z9pc9vq2xq2qpavwmh7fvzvvjkc495ssxsh8cs044qflvj54b2"; + }; + + buildPhase = null; + + installPhase = '' + mkdir -p $out/bin + + cp $src/bin/ircsink $out/bin/ircsink + sed -i ' + s;^#! /bin/sh;#! ${pkgs.dash}/bin/dash; + s;^#!.*;&\nexport PATH=${lib.makeBinPath [ + pkgs.coreutils + pkgs.gawk + pkgs.gnused + pkgs.netcat + pkgs.nettools + pkgs.openssl + pkgs.utillinux + ]}; + ' $out/bin/ircsink + ''; +} -- cgit v1.2.3 From 1b65517b444daa190a9cb80ea85a85d49bd0d394 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Oct 2021 23:09:44 +0200 Subject: irc-announce: use ircaids --- krebs/5pkgs/simple/irc-announce/default.nix | 74 +++++------------------------ 1 file changed, 11 insertions(+), 63 deletions(-) diff --git a/krebs/5pkgs/simple/irc-announce/default.nix b/krebs/5pkgs/simple/irc-announce/default.nix index 5797b3667..7b2af0307 100644 --- a/krebs/5pkgs/simple/irc-announce/default.nix +++ b/krebs/5pkgs/simple/irc-announce/default.nix @@ -1,18 +1,8 @@ { pkgs, lib, ... }: -with lib; - pkgs.writeDashBin "irc-announce" '' set -euf - export PATH=${makeSearchPath "bin" (with pkgs; [ - coreutils - gawk - gnused - netcat - nettools - ])} - IRC_SERVER=$1 IRC_PORT=$2 IRC_NICK=$3_$$ @@ -20,57 +10,15 @@ pkgs.writeDashBin "irc-announce" '' IRC_TLS=$5 message=$6 - export IRC_CHANNEL # for privmsg_cat - - # echo2 and cat2 are used output to both, stdout and stderr - # This is used to see what we send to the irc server. (debug output) - echo2() { echo "$*"; echo "$*" >&2; } - cat2() { - awk '{ - print $0 - print $0 > "/dev/stderr" - }' - } - - # privmsg_cat transforms stdin to a privmsg - privmsg_cat() { awk '{ print "PRIVMSG "ENVIRON["IRC_CHANNEL"]" :"$0 }'; } - - tls_flag() { if [ "$IRC_TLS" -eq 1 ]; then echo "-c"; fi } - - # ircin is used to feed the output of netcat back to the "irc client" - # so we can implement expect-like behavior with sed^_^ - # XXX mkselfdestructingtmpfifo would be nice instead of this cruft - tmpdir=$(mktemp --tmpdir -d irc-announce_XXXXXXXX) - cd "$tmpdir" - mkfifo ircin - trap " - rm ircin - cd '$OLDPWD' - rmdir '$tmpdir' - trap - EXIT INT QUIT - " EXIT INT QUIT - - { - echo2 "USER $LOGNAME 0 * :$LOGNAME@$(hostname)" - echo2 "NICK $IRC_NICK" - - awk 'match($0, /PING(.*)/, m) {print "PONG", m[1]; exit}' - - # wait for MODE message - sed -n '/^:[^ ]* MODE /q' - - echo2 "JOIN $IRC_CHANNEL" - - printf '%s' "$message" \ - | privmsg_cat \ - | cat2 - - echo2 "PART $IRC_CHANNEL" - - # wait for PART confirmation - sed -n '/:'"$IRC_NICK"'![^ ]* PART /q' - - echo2 'QUIT :Gone to have lunch' - } < ircin \ - | nc $(tls_flag) "$IRC_SERVER" "$IRC_PORT" | tee -a ircin + if test "$IRC_TLS" != 1; then + unset IRC_TLS + fi + + printf %s "$message" | + ${pkgs.ircaids}/bin/ircsink \ + --nick="$IRC_NICK" \ + --port="$IRC_PORT" \ + --server="$IRC_SERVER" \ + --target="$IRC_CHANNEL" \ + ''${IRC_TLS:+--secure} '' -- cgit v1.2.3 From f05c7cb7fffe4cdc9d5d4af260770fcdaba6ba61 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 9 Oct 2021 18:47:32 +0200 Subject: nixpkgs: 6120ac5 -> ce7a119 --- krebs/nixpkgs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index d0a011869..bf2808dce 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "6120ac5cd201f6cb593d1b80e861be0342495be9", - "date": "2021-09-18T21:31:09+02:00", - "path": "/nix/store/g1a0swq7h7b24g4vkn3wr3d8rwjazfmv-nixpkgs", - "sha256": "04mrjxr1qsdcgcryx7yy72cgcw14c0770gfcgzrdfpnvmjdgbi9i", + "rev": "ce7a1190a0fa4ba3465b5f5471b08567060ca14c", + "date": "2021-10-08T11:14:43-05:00", + "path": "/nix/store/y01vzcdhna8pjvy3w2bz7nc9zqyylxg3-nixpkgs", + "sha256": "1zr1s9gp0h5g4arlba1bpb9yqfaaby5195ydm6a2psaxhm748li9", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false -- cgit v1.2.3 From bc8acddc12dc409836d45bd1d1847f51ffd06ff9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 9 Oct 2021 18:47:49 +0200 Subject: nixpkgs-unstable: 09cd65b -> 70088dc --- krebs/nixpkgs-unstable.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json index 6b5f8ec8f..e464cb568 100644 --- a/krebs/nixpkgs-unstable.json +++ b/krebs/nixpkgs-unstable.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "09cd65b33c5653d7d2954fef4b9f0e718c899743", - "date": "2021-09-08T11:21:07-05:00", - "path": "/nix/store/h4hgs0aiaszmgqcwwhw7q10vqgvgbimf-nixpkgs", - "sha256": "1h696xv2wdl1859jcr0bmv0m0rfsq4vpc1vc0hg3msfsdnz0aixl", + "rev": "70088dc29994c32f8520150e34c6e57e8453f895", + "date": "2021-10-07T22:46:35+08:00", + "path": "/nix/store/f0i4rdi62kkwa95v7ap8fzxybrikqi01-nixpkgs", + "sha256": "08ldqfh2cmbvf930yq9pv220sv83k9shq183935l5d8p61fxh5zr", "fetchSubmodules": false, "deepClone": false, "leaveDotGit": false -- cgit v1.2.3 From e4793149c011da50a4ff2b44fbe80aef83936d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sun, 10 Oct 2021 12:45:52 +0200 Subject: external: add bvg.kmein.r alias --- krebs/3modules/external/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index eff2967e0..025fb986a 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -263,6 +263,7 @@ in { "zaatar.r" "zaatar.kmein.r" "radio.kmein.r" + "bvg.kmein.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- -- cgit v1.2.3 From 55bdc0f653b398d49c5c95d98da797b2b8d5393e Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 12 Oct 2021 15:35:52 +0200 Subject: l codimd: set domain and serve via ssl --- lass/2configs/codimd.nix | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/lass/2configs/codimd.nix b/lass/2configs/codimd.nix index d29a65210..070781a31 100644 --- a/lass/2configs/codimd.nix +++ b/lass/2configs/codimd.nix @@ -1,27 +1,44 @@ { config, pkgs, lib, ... }: with import ; -{ - services.nginx.virtualHosts.codimd = { +let + domain = "codi.lassul.us"; +in { + services.nginx.virtualHosts.${domain} = { enableACME = true; - addSSL = true; - serverName = "codi.lassul.us"; - locations."/".extraConfig = '' - client_max_body_size 4G; - proxy_set_header Host $host; - proxy_pass http://localhost:3091; - ''; + forceSSL = true; + locations."/" = { + proxyPass = "https://localhost:3091"; + proxyWebsockets = true; + }; + }; + + security.acme.certs.${domain}.group = "hedgecert"; + users.groups.hedgecert.members = [ "codimd" "nginx" ]; + + security.dhparams = { + enable = true; + params.hedgedoc = {}; }; services.hedgedoc = { enable = true; - configuration.allowOrigin = [ "*" ]; + configuration.allowOrigin = [ domain ]; configuration = { db = { dialect = "sqlite"; storage = "/var/lib/codimd/db.codimd.sqlite"; - useCDN = false; }; + useCDN = false; port = 3091; + domain = domain; + allowFreeURL = true; + + useSSL = true; + protocolUseSSL = true; + sslCAPath = [ "/etc/ssl/certs/ca-certificates.crt" ]; + sslCertPath = "/var/lib/acme/${domain}/cert.pem"; + sslKeyPath = "/var/lib/acme/${domain}/key.pem"; + dhParamPath = config.security.dhparams.params.hedgedoc.path; }; }; } -- cgit v1.2.3 From 780a04e991c46a111c38281fced75f9c38e972f8 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 12 Oct 2021 20:07:54 +0200 Subject: ircaids: move to dir --- krebs/5pkgs/simple/ircaids.nix | 32 -------------------------------- krebs/5pkgs/simple/ircaids/default.nix | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 krebs/5pkgs/simple/ircaids.nix create mode 100644 krebs/5pkgs/simple/ircaids/default.nix diff --git a/krebs/5pkgs/simple/ircaids.nix b/krebs/5pkgs/simple/ircaids.nix deleted file mode 100644 index 566346cc9..000000000 --- a/krebs/5pkgs/simple/ircaids.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib, pkgs, stdenv }: - -stdenv.mkDerivation rec { - pname = "ircaids"; - version = "1.0.0"; - - src = pkgs.fetchgit { - url = "https://cgit.krebsco.de/ircaids"; - rev = "refs/tags/${version}"; - sha256 = "13z9pc9vq2xq2qpavwmh7fvzvvjkc495ssxsh8cs044qflvj54b2"; - }; - - buildPhase = null; - - installPhase = '' - mkdir -p $out/bin - - cp $src/bin/ircsink $out/bin/ircsink - sed -i ' - s;^#! /bin/sh;#! ${pkgs.dash}/bin/dash; - s;^#!.*;&\nexport PATH=${lib.makeBinPath [ - pkgs.coreutils - pkgs.gawk - pkgs.gnused - pkgs.netcat - pkgs.nettools - pkgs.openssl - pkgs.utillinux - ]}; - ' $out/bin/ircsink - ''; -} diff --git a/krebs/5pkgs/simple/ircaids/default.nix b/krebs/5pkgs/simple/ircaids/default.nix new file mode 100644 index 000000000..566346cc9 --- /dev/null +++ b/krebs/5pkgs/simple/ircaids/default.nix @@ -0,0 +1,32 @@ +{ lib, pkgs, stdenv }: + +stdenv.mkDerivation rec { + pname = "ircaids"; + version = "1.0.0"; + + src = pkgs.fetchgit { + url = "https://cgit.krebsco.de/ircaids"; + rev = "refs/tags/${version}"; + sha256 = "13z9pc9vq2xq2qpavwmh7fvzvvjkc495ssxsh8cs044qflvj54b2"; + }; + + buildPhase = null; + + installPhase = '' + mkdir -p $out/bin + + cp $src/bin/ircsink $out/bin/ircsink + sed -i ' + s;^#! /bin/sh;#! ${pkgs.dash}/bin/dash; + s;^#!.*;&\nexport PATH=${lib.makeBinPath [ + pkgs.coreutils + pkgs.gawk + pkgs.gnused + pkgs.netcat + pkgs.nettools + pkgs.openssl + pkgs.utillinux + ]}; + ' $out/bin/ircsink + ''; +} -- cgit v1.2.3 From 77c3aab5b860a952e9d83db56aefe23ee04ccebc Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 12 Oct 2021 19:36:09 +0200 Subject: pkgs: use relative stockholm.lib --- krebs/5pkgs/default.nix | 3 +-- krebs/5pkgs/haskell/blessings.nix | 5 +++-- krebs/5pkgs/haskell/default.nix | 5 +++-- krebs/5pkgs/haskell/email-header.nix | 8 +++++--- krebs/5pkgs/override/default.nix | 1 - krebs/5pkgs/simple/bling/default.nix | 5 ++--- krebs/5pkgs/simple/cgit-clear-cache.nix | 6 ++---- krebs/5pkgs/simple/default.nix | 15 +++++++-------- krebs/5pkgs/simple/eximlog.nix | 4 ++-- krebs/5pkgs/simple/flameshot-once/default.nix | 4 ++-- krebs/5pkgs/simple/flameshot-once/profile.nix | 2 +- krebs/5pkgs/simple/fzfmenu/default.nix | 4 ++-- krebs/5pkgs/simple/git-hooks/default.nix | 4 ++-- krebs/5pkgs/simple/htgen-cyberlocker/default.nix | 5 +++-- krebs/5pkgs/simple/htgen-imgur/default.nix | 7 +++---- krebs/5pkgs/simple/logf/default.nix | 2 -- krebs/5pkgs/simple/netcup/default.nix | 5 +++-- krebs/5pkgs/simple/reaktor2-plugins.nix | 4 ++-- krebs/5pkgs/simple/urix.nix | 5 ++--- krebs/5pkgs/simple/withGetopt.nix | 4 ++-- krebs/5pkgs/test/default.nix | 2 -- 21 files changed, 47 insertions(+), 53 deletions(-) diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index c077bf4d7..f302bb76b 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -1,5 +1,4 @@ -with import ; - +with import ../../lib; self: super: # Import files and subdirectories like they are overlays. diff --git a/krebs/5pkgs/haskell/blessings.nix b/krebs/5pkgs/haskell/blessings.nix index b0e81fdc1..00299ca68 100644 --- a/krebs/5pkgs/haskell/blessings.nix +++ b/krebs/5pkgs/haskell/blessings.nix @@ -1,6 +1,7 @@ -with import ; -{ mkDerivation, base, fetchgit, hspec, QuickCheck, stdenv, text }: let +{ mkDerivation, base, fetchgit, hspec, QuickCheck, stdenv, stockholm, text }: +with stockholm.lib; +let cfg = { "18.03" = { version = "1.1.0"; diff --git a/krebs/5pkgs/haskell/default.nix b/krebs/5pkgs/haskell/default.nix index e824699f9..98cbcb3b9 100644 --- a/krebs/5pkgs/haskell/default.nix +++ b/krebs/5pkgs/haskell/default.nix @@ -1,8 +1,9 @@ -with import ; +self: super: +with self.stockholm.lib; + let overrides = self: super: mapNixDir (path: self.callPackage path {}) ./.; in -self: super: { haskell = super.haskell // { packages = mapAttrs (name: value: diff --git a/krebs/5pkgs/haskell/email-header.nix b/krebs/5pkgs/haskell/email-header.nix index 94b33e28b..ccc32c09b 100644 --- a/krebs/5pkgs/haskell/email-header.nix +++ b/krebs/5pkgs/haskell/email-header.nix @@ -1,8 +1,10 @@ -with import ; { mkDerivation, attoparsec, base, base64-bytestring, bytestring , case-insensitive, containers, exceptions, fetchgit, QuickCheck -, stdenv, tasty, tasty-quickcheck, text, text-icu, time -}: let +, stdenv, stockholm, tasty, tasty-quickcheck, text, text-icu, time +}: +with stockholm.lib; + +let cfg = { "18.03" = { diff --git a/krebs/5pkgs/override/default.nix b/krebs/5pkgs/override/default.nix index c2149ae55..2291132ba 100644 --- a/krebs/5pkgs/override/default.nix +++ b/krebs/5pkgs/override/default.nix @@ -1,4 +1,3 @@ -with import ; self: super: { bitlbee-facebook = super.bitlbee-facebook.overrideAttrs (old: { diff --git a/krebs/5pkgs/simple/bling/default.nix b/krebs/5pkgs/simple/bling/default.nix index 8d6207f65..1c8610325 100644 --- a/krebs/5pkgs/simple/bling/default.nix +++ b/krebs/5pkgs/simple/bling/default.nix @@ -1,6 +1,5 @@ -{ imagemagick, runCommand, ... }: - -with import ; +{ imagemagick, runCommand, stockholm, ... }: +with stockholm.lib; let krebs-v2 = [ diff --git a/krebs/5pkgs/simple/cgit-clear-cache.nix b/krebs/5pkgs/simple/cgit-clear-cache.nix index 28402c39c..31a2eccb3 100644 --- a/krebs/5pkgs/simple/cgit-clear-cache.nix +++ b/krebs/5pkgs/simple/cgit-clear-cache.nix @@ -1,8 +1,6 @@ -with import ; - -{ cache-root ? "/tmp/cgit", findutils, writeDashBin }: +{ cache-root ? "/tmp/cgit", findutils, stockholm, writeDashBin }: writeDashBin "cgit-clear-cache" '' set -efu - ${findutils}/bin/find ${shell.escape cache-root} -type f -delete + ${findutils}/bin/find ${stockholm.lib.shell.escape cache-root} -type f -delete '' diff --git a/krebs/5pkgs/simple/default.nix b/krebs/5pkgs/simple/default.nix index 6ba4fec83..10458001e 100644 --- a/krebs/5pkgs/simple/default.nix +++ b/krebs/5pkgs/simple/default.nix @@ -1,18 +1,17 @@ -with import ; - self: super: let # This callPackage will try to detect obsolete overrides. + lib = import ../../../lib; callPackage = path: args: let override = self.callPackage path args; - upstream = optionalAttrs (override ? "name") - (super.${(parseDrvName override.name).name} or {}); + upstream = lib.optionalAttrs (override ? "name") + (super.${(lib.parseDrvName override.name).name} or {}); in if upstream ? "name" && override ? "name" && - compareVersions upstream.name override.name != -1 - then trace "Upstream `${upstream.name}' gets overridden by `${override.name}'." override + lib.compareVersions upstream.name override.name != -1 + then lib.trace "Upstream `${upstream.name}' gets overridden by `${override.name}'." override else override; in - - mapNixDir (path: callPackage path {}) ./. + { stockholm.lib = lib; } // + lib.mapNixDir (path: callPackage path {}) ./. diff --git a/krebs/5pkgs/simple/eximlog.nix b/krebs/5pkgs/simple/eximlog.nix index 2d64e13e9..9e5ae8d63 100644 --- a/krebs/5pkgs/simple/eximlog.nix +++ b/krebs/5pkgs/simple/eximlog.nix @@ -1,7 +1,7 @@ -{ jq, systemd, writeDashBin }: +{ jq, stockholm, systemd, writeDashBin }: let - lib = import ; + lib = stockholm.lib; user = "exim"; # TODO make this configurable in diff --git a/krebs/5pkgs/simple/flameshot-once/default.nix b/krebs/5pkgs/simple/flameshot-once/default.nix index 20c709fb5..0524c2cfa 100644 --- a/krebs/5pkgs/simple/flameshot-once/default.nix +++ b/krebs/5pkgs/simple/flameshot-once/default.nix @@ -1,5 +1,5 @@ -with import ; -{ pkgs, ... }@args: +{ pkgs, stockholm, ... }@args: +with stockholm.lib; let # config cannot be declared in the input attribute set because that would diff --git a/krebs/5pkgs/simple/flameshot-once/profile.nix b/krebs/5pkgs/simple/flameshot-once/profile.nix index 8aacbfa42..991b46118 100644 --- a/krebs/5pkgs/simple/flameshot-once/profile.nix +++ b/krebs/5pkgs/simple/flameshot-once/profile.nix @@ -1,5 +1,5 @@ -with import ; { config, pkgs }: +with pkgs.stockholm.lib; let # Refs https://github.com/lupoDharkael/flameshot/blob/master/src/widgets/capture/capturebutton.h diff --git a/krebs/5pkgs/simple/fzfmenu/default.nix b/krebs/5pkgs/simple/fzfmenu/default.nix index 537b90f42..f208f6a3e 100644 --- a/krebs/5pkgs/simple/fzfmenu/default.nix +++ b/krebs/5pkgs/simple/fzfmenu/default.nix @@ -1,5 +1,5 @@ -with import ; -{ pkgs, ... }@args: +{ pkgs, stockholm, ... }@args: +with stockholm.lib; let # config cannot be declared in the input attribute set because that would diff --git a/krebs/5pkgs/simple/git-hooks/default.nix b/krebs/5pkgs/simple/git-hooks/default.nix index acf34ad69..00a593be3 100644 --- a/krebs/5pkgs/simple/git-hooks/default.nix +++ b/krebs/5pkgs/simple/git-hooks/default.nix @@ -1,6 +1,6 @@ -{ pkgs, ... }: +{ pkgs, stockholm, ... }: -with import ; +with stockholm.lib; { # TODO irc-announce should return a derivation diff --git a/krebs/5pkgs/simple/htgen-cyberlocker/default.nix b/krebs/5pkgs/simple/htgen-cyberlocker/default.nix index 515ea3cf9..c7d7ebfd8 100644 --- a/krebs/5pkgs/simple/htgen-cyberlocker/default.nix +++ b/krebs/5pkgs/simple/htgen-cyberlocker/default.nix @@ -1,5 +1,6 @@ -with import ; -{ pkgs, stdenv }: +{ pkgs, stockholm, stdenv }: +with stockholm.lib; + stdenv.mkDerivation rec { pname = "htgen-cyberlocker"; version = "1.0.0"; diff --git a/krebs/5pkgs/simple/htgen-imgur/default.nix b/krebs/5pkgs/simple/htgen-imgur/default.nix index fe0b2ab04..f429ff7a6 100644 --- a/krebs/5pkgs/simple/htgen-imgur/default.nix +++ b/krebs/5pkgs/simple/htgen-imgur/default.nix @@ -1,5 +1,4 @@ -with import ; -{ attr, coreutils, exiv2, findutils, gnugrep, jq, nix, utillinux, stdenv }: +{ attr, coreutils, exiv2, findutils, gnugrep, jq, nix, stockholm, utillinux, stdenv }: stdenv.mkDerivation rec { pname = "htgen-imgur"; version = "1.0.0"; @@ -9,7 +8,7 @@ stdenv.mkDerivation rec { buildPhase = '' ( exec > htgen-imgur - echo PATH=${makeBinPath [ + echo PATH=${stockholm.lib.makeBinPath [ attr coreutils exiv2 @@ -18,7 +17,7 @@ stdenv.mkDerivation rec { jq nix utillinux ]} - echo STATEDIR=${shell.escape "\${STATEDIR-$HOME}"} + echo STATEDIR=${stockholm.lib.shell.escape "\${STATEDIR-$HOME}"} cat $src/htgen-imgur ) ''; diff --git a/krebs/5pkgs/simple/logf/default.nix b/krebs/5pkgs/simple/logf/default.nix index ac95acb33..36a7fed2f 100644 --- a/krebs/5pkgs/simple/logf/default.nix +++ b/krebs/5pkgs/simple/logf/default.nix @@ -1,7 +1,5 @@ { lib, pkgs, ... }: -with import ; - let default-host-colors = pkgs.writeJSON "logf.default-host-colors.json" { }; diff --git a/krebs/5pkgs/simple/netcup/default.nix b/krebs/5pkgs/simple/netcup/default.nix index d1f46299d..408672eff 100644 --- a/krebs/5pkgs/simple/netcup/default.nix +++ b/krebs/5pkgs/simple/netcup/default.nix @@ -1,5 +1,6 @@ -{ coreutils, curl, fetchgit, gawk, gnugrep, gnused, jq, stdenv, w3m, ... }: -with import ; +{ coreutils, curl, fetchgit, gawk, gnugrep, gnused, jq, stdenv, stockholm, w3m, ... }: +with stockholm.lib; + let readJSON = path: fromJSON (readFile path); sed.escape = replaceChars ["/"] ["\\/"]; # close enough diff --git a/krebs/5pkgs/simple/reaktor2-plugins.nix b/krebs/5pkgs/simple/reaktor2-plugins.nix index 4cd9e7d89..e23b14a23 100644 --- a/krebs/5pkgs/simple/reaktor2-plugins.nix +++ b/krebs/5pkgs/simple/reaktor2-plugins.nix @@ -1,5 +1,5 @@ -with import ; -{ lib, pkgs, ... }: +{ lib, pkgs, stockholm, ... }: +with stockholm.lib; rec { generators = { diff --git a/krebs/5pkgs/simple/urix.nix b/krebs/5pkgs/simple/urix.nix index c0db8c975..73ea3e665 100644 --- a/krebs/5pkgs/simple/urix.nix +++ b/krebs/5pkgs/simple/urix.nix @@ -1,5 +1,4 @@ -let lib = import ; in -{ pkgs }: +{ pkgs, stockholm }: # urix - URI eXtractor # Extract all the URIs from standard input and write them to standard output! @@ -10,6 +9,6 @@ pkgs.execBin "urix" { argv = [ "urix" "-Eo" - "\\b${lib.uri.posix-extended-regex}\\b" + "\\b${stockholm.lib.uri.posix-extended-regex}\\b" ]; } diff --git a/krebs/5pkgs/simple/withGetopt.nix b/krebs/5pkgs/simple/withGetopt.nix index d20802fb2..7f17a5934 100644 --- a/krebs/5pkgs/simple/withGetopt.nix +++ b/krebs/5pkgs/simple/withGetopt.nix @@ -1,5 +1,5 @@ -with import ; -{ coreutils, quote, utillinux, writeDash }: +{ coreutils, quote, stockholm, utillinux, writeDash }: +with stockholm.lib; opt-spec: cmd-spec: let diff --git a/krebs/5pkgs/test/default.nix b/krebs/5pkgs/test/default.nix index 5ee8f913b..713d4673c 100644 --- a/krebs/5pkgs/test/default.nix +++ b/krebs/5pkgs/test/default.nix @@ -1,5 +1,3 @@ -with import ; - self: super: { -- cgit v1.2.3 From be5f4833fe1dc3ec4acb24eeb5a6670c2aaef2e0 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 12 Oct 2021 22:08:07 +0200 Subject: pkgs: import relative stockholm lib only once New overlay code in inspired by . --- krebs/5pkgs/default.nix | 30 ++++++++++++++++++------------ krebs/5pkgs/simple/default.nix | 5 ++--- krebs/default.nix | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index f302bb76b..f9ed6439c 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -1,17 +1,23 @@ -with import ../../lib; +let + stockholm.lib = import ../../lib; +in +with stockholm.lib; self: super: - -# Import files and subdirectories like they are overlays. -foldl' mergeAttrs {} +fix (foldl' (flip extends) (self: super) ( + [ + (self: super: { inherit stockholm; }) + ] + ++ (map - (name: import (./. + "/${name}") self super) + (name: import (./. + "/${name}")) (filter (name: name != "default.nix" && !hasPrefix "." name) (attrNames (readDir ./.)))) - -// - -{ - brockman = self.haskellPackages.brockman; - reaktor2 = self.haskellPackages.reaktor2; -} + ++ + [ + (self: super: { + brockman = self.haskellPackages.brockman; + reaktor2 = self.haskellPackages.reaktor2; + }) + ] +)) diff --git a/krebs/5pkgs/simple/default.nix b/krebs/5pkgs/simple/default.nix index 10458001e..76ad6ff10 100644 --- a/krebs/5pkgs/simple/default.nix +++ b/krebs/5pkgs/simple/default.nix @@ -2,7 +2,7 @@ self: super: let # This callPackage will try to detect obsolete overrides. - lib = import ../../../lib; + lib = super.stockholm.lib; callPackage = path: args: let override = self.callPackage path args; upstream = lib.optionalAttrs (override ? "name") @@ -13,5 +13,4 @@ let then lib.trace "Upstream `${upstream.name}' gets overridden by `${override.name}'." override else override; in - { stockholm.lib = lib; } // - lib.mapNixDir (path: callPackage path {}) ./. + lib.mapNixDir (path: callPackage path {}) ./. diff --git a/krebs/default.nix b/krebs/default.nix index 7ec791529..577cc269e 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -6,8 +6,8 @@ nixpkgs = { overlays = [ - (import ./5pkgs) (import ../submodules/nix-writers/pkgs) + (import ./5pkgs) ]; }; -- cgit v1.2.3 From 411cb36608f1e408b18ffff33ad30fc55775e2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Tue, 12 Oct 2021 22:08:43 +0200 Subject: external: add names.kmein.r alias --- krebs/3modules/external/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index 025fb986a..982516e5d 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -150,6 +150,7 @@ in { "makanek.r" "makanek.kmein.r" "grafana.kmein.r" + "names.kmein.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- -- cgit v1.2.3 From a9bba92e0e2e63af4ef470327d30d1e873af53eb Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 19 Oct 2021 22:51:26 +0200 Subject: krebs: stdenv.lib -> lib --- krebs/5pkgs/haskell/X11-aeson.nix | 4 ++-- krebs/5pkgs/haskell/blessings.nix | 4 ++-- krebs/5pkgs/haskell/brockman/default.nix | 4 ++-- krebs/5pkgs/haskell/email-header.nix | 4 ++-- krebs/5pkgs/haskell/hack.nix | 5 ++--- krebs/5pkgs/haskell/kirk.nix | 7 ++++--- krebs/5pkgs/haskell/much.nix | 8 ++++---- krebs/5pkgs/haskell/news.nix | 4 ++-- krebs/5pkgs/haskell/reaktor2/default.nix | 4 ++-- krebs/5pkgs/haskell/recht.nix | 4 ++-- krebs/5pkgs/haskell/scanner.nix | 4 ++-- krebs/5pkgs/haskell/xmonad-aeson.nix | 4 ++-- krebs/5pkgs/haskell/xmonad-stockholm.nix | 4 ++-- krebs/5pkgs/simple/buildbot-classic/sqlparse.nix | 4 ++-- 14 files changed, 32 insertions(+), 32 deletions(-) diff --git a/krebs/5pkgs/haskell/X11-aeson.nix b/krebs/5pkgs/haskell/X11-aeson.nix index 7db6c28a8..103d87faa 100644 --- a/krebs/5pkgs/haskell/X11-aeson.nix +++ b/krebs/5pkgs/haskell/X11-aeson.nix @@ -1,4 +1,4 @@ -{ mkDerivation, aeson, base, fetchgit, stdenv, X11 }: +{ mkDerivation, aeson, base, fetchgit, lib, X11 }: mkDerivation { pname = "X11-aeson"; version = "1.0.0"; @@ -9,5 +9,5 @@ mkDerivation { fetchSubmodules = true; }; libraryHaskellDepends = [ aeson base X11 ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/blessings.nix b/krebs/5pkgs/haskell/blessings.nix index 00299ca68..2176db2ff 100644 --- a/krebs/5pkgs/haskell/blessings.nix +++ b/krebs/5pkgs/haskell/blessings.nix @@ -1,4 +1,4 @@ -{ mkDerivation, base, fetchgit, hspec, QuickCheck, stdenv, stockholm, text }: +{ mkDerivation, base, fetchgit, hspec, QuickCheck, lib, stockholm, text }: with stockholm.lib; let @@ -24,5 +24,5 @@ in mkDerivation { testHaskellDepends = [ base hspec QuickCheck ]; doHaddock = false; # WTFPL is the true license, which is unknown to cabal. - license = stdenv.lib.licenses.wtfpl; + license = lib.licenses.wtfpl; } diff --git a/krebs/5pkgs/haskell/brockman/default.nix b/krebs/5pkgs/haskell/brockman/default.nix index d3dbcd89c..de41d1886 100644 --- a/krebs/5pkgs/haskell/brockman/default.nix +++ b/krebs/5pkgs/haskell/brockman/default.nix @@ -2,7 +2,7 @@ , case-insensitive, conduit, containers, directory, feed, filepath , hashable, hslogger, html-entity, http-client, irc-conduit, lens , lrucache, lrucaching, network, optparse-applicative, random, safe -, stdenv, text, time, timerep, wreq +, lib, text, time, timerep, wreq , fetchFromGitHub }: mkDerivation rec { @@ -22,5 +22,5 @@ mkDerivation rec { http-client irc-conduit lens lrucache lrucaching network optparse-applicative random safe text time timerep wreq ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/email-header.nix b/krebs/5pkgs/haskell/email-header.nix index ccc32c09b..e1e9d423f 100644 --- a/krebs/5pkgs/haskell/email-header.nix +++ b/krebs/5pkgs/haskell/email-header.nix @@ -1,6 +1,6 @@ { mkDerivation, attoparsec, base, base64-bytestring, bytestring , case-insensitive, containers, exceptions, fetchgit, QuickCheck -, stdenv, stockholm, tasty, tasty-quickcheck, text, text-icu, time +, lib, stockholm, tasty, tasty-quickcheck, text, text-icu, time }: with stockholm.lib; @@ -42,5 +42,5 @@ in mkDerivation { jailbreak = true; homepage = "http://github.com/knrafto/email-header"; description = "Parsing and rendering of email and MIME headers"; - license = stdenv.lib.licenses.bsd3; + license = lib.licenses.bsd3; } diff --git a/krebs/5pkgs/haskell/hack.nix b/krebs/5pkgs/haskell/hack.nix index 4e157107e..37ef94e46 100644 --- a/krebs/5pkgs/haskell/hack.nix +++ b/krebs/5pkgs/haskell/hack.nix @@ -1,6 +1,5 @@ { mkDerivation, base, blessings, containers, data-default, fetchgit -, lens, mtl, old-locale, process, scanner, stdenv, time, unix -, zippers +, lens, lib, mtl, old-locale, process, scanner, time, unix, zippers }: mkDerivation { pname = "hack"; @@ -18,5 +17,5 @@ mkDerivation { base blessings containers data-default lens mtl old-locale process scanner time unix zippers ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/kirk.nix b/krebs/5pkgs/haskell/kirk.nix index 073e5d505..d6fdec4c9 100644 --- a/krebs/5pkgs/haskell/kirk.nix +++ b/krebs/5pkgs/haskell/kirk.nix @@ -1,5 +1,5 @@ -{ mkDerivation, async, base, bytestring, fetchgit, network -, optparse-applicative, stdenv, text +{ mkDerivation, async, base, bytestring, fetchgit, lib, network +, optparse-applicative, text }: mkDerivation { pname = "kirk"; @@ -8,6 +8,7 @@ mkDerivation { url = "http://cgit.krebsco.de/kirk"; sha256 = "1acsmmc485c54axpy9bd0320j18hs261vl1vdxns4n04sxzqd7k0"; rev = "cdf3cb373af8f9b03a9487a63eb32e0226913589"; + fetchSubmodules = true; }; isLibrary = true; isExecutable = true; @@ -17,5 +18,5 @@ mkDerivation { executableHaskellDepends = [ async base network optparse-applicative text ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/much.nix b/krebs/5pkgs/haskell/much.nix index 0a5453c0c..f3aad2ee6 100644 --- a/krebs/5pkgs/haskell/much.nix +++ b/krebs/5pkgs/haskell/much.nix @@ -2,9 +2,9 @@ , blaze-builder, blessings, bytestring, case-insensitive , containers, data-default, deepseq, directory, either , email-header, fetchgit, filepath, friendly-time, http-types -, hyphenation, linebreak, network, old-locale, optparse-applicative -, process, random, rosezipper, safe, scanner, servant-server, split -, stdenv, terminal-size, text, time, transformers +, hyphenation, lib, linebreak, network, old-locale +, optparse-applicative, process, random, rosezipper, safe, scanner +, servant-server, split, terminal-size, text, time, transformers , transformers-compat, unix, vector, wai, warp }: mkDerivation { @@ -32,5 +32,5 @@ mkDerivation { data-default deepseq directory filepath hyphenation linebreak process rosezipper safe scanner text time transformers unix ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/news.nix b/krebs/5pkgs/haskell/news.nix index ba5e7a5e1..0274ac8d5 100644 --- a/krebs/5pkgs/haskell/news.nix +++ b/krebs/5pkgs/haskell/news.nix @@ -1,5 +1,5 @@ { mkDerivation, base, bloomfilter, bytestring, feed, fetchgit, lens -, stdenv, wreq +, lib, wreq }: mkDerivation { pname = "news"; @@ -14,5 +14,5 @@ mkDerivation { executableHaskellDepends = [ base bloomfilter bytestring feed lens wreq ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/reaktor2/default.nix b/krebs/5pkgs/haskell/reaktor2/default.nix index 6a48f865c..d41d8d818 100644 --- a/krebs/5pkgs/haskell/reaktor2/default.nix +++ b/krebs/5pkgs/haskell/reaktor2/default.nix @@ -2,7 +2,7 @@ , bytestring, containers, data-default, fetchgit, filepath , hashable, lens, lens-aeson, network, network-simple , network-simple-tls, network-uri, pcre-light, process, random -, servant-server, stdenv, string-conversions, stringsearch, text +, servant-server, lib, string-conversions, stringsearch, text , time, transformers, unagi-chan, unix, unordered-containers , vector, wai, warp }: @@ -24,5 +24,5 @@ mkDerivation rec { random servant-server string-conversions stringsearch text time transformers unagi-chan unix unordered-containers vector wai warp ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/recht.nix b/krebs/5pkgs/haskell/recht.nix index 7d884a9fa..bf62d3697 100644 --- a/krebs/5pkgs/haskell/recht.nix +++ b/krebs/5pkgs/haskell/recht.nix @@ -1,6 +1,6 @@ { mkDerivation, ansi-terminal, async, base, binary, bytestring , data-default, directory, filepath, megaparsec -, optparse-applicative, pandoc, random, safe, scalpel, stdenv, text +, optparse-applicative, pandoc, random, safe, scalpel, lib, text , time , fetchFromGitHub }: @@ -21,5 +21,5 @@ mkDerivation rec { filepath megaparsec optparse-applicative pandoc random safe scalpel text time ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/scanner.nix b/krebs/5pkgs/haskell/scanner.nix index 28f89b069..a317e575e 100644 --- a/krebs/5pkgs/haskell/scanner.nix +++ b/krebs/5pkgs/haskell/scanner.nix @@ -1,4 +1,4 @@ -{ mkDerivation, base, fetchgit, stdenv }: +{ mkDerivation, base, fetchgit, lib }: mkDerivation { pname = "scanner"; version = "1.0.1"; @@ -9,5 +9,5 @@ mkDerivation { fetchSubmodules = true; }; libraryHaskellDepends = [ base ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/xmonad-aeson.nix b/krebs/5pkgs/haskell/xmonad-aeson.nix index 3fccab469..d27f9c783 100644 --- a/krebs/5pkgs/haskell/xmonad-aeson.nix +++ b/krebs/5pkgs/haskell/xmonad-aeson.nix @@ -1,4 +1,4 @@ -{ mkDerivation, aeson, base, fetchgit, stdenv, X11-aeson, xmonad }: +{ mkDerivation, aeson, base, fetchgit, lib, X11-aeson, xmonad }: mkDerivation { pname = "xmonad-aeson"; version = "1.0.0"; @@ -9,5 +9,5 @@ mkDerivation { fetchSubmodules = true; }; libraryHaskellDepends = [ aeson base X11-aeson xmonad ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/haskell/xmonad-stockholm.nix b/krebs/5pkgs/haskell/xmonad-stockholm.nix index 1b197b914..751f26749 100644 --- a/krebs/5pkgs/haskell/xmonad-stockholm.nix +++ b/krebs/5pkgs/haskell/xmonad-stockholm.nix @@ -1,4 +1,4 @@ -{ mkDerivation, base, containers, fetchgit, filepath, stdenv, unix, X11, X11-xft , X11-xshape, xmonad, xmonad-contrib +{ mkDerivation, base, containers, fetchgit, filepath, lib, unix, X11, X11-xft , X11-xshape, xmonad, xmonad-contrib }: mkDerivation rec { pname = "xmonad-stockholm"; @@ -11,5 +11,5 @@ mkDerivation rec { libraryHaskellDepends = [ base containers filepath unix X11 X11-xft X11-xshape xmonad xmonad-contrib ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/krebs/5pkgs/simple/buildbot-classic/sqlparse.nix b/krebs/5pkgs/simple/buildbot-classic/sqlparse.nix index b6aee633e..2cbb51845 100644 --- a/krebs/5pkgs/simple/buildbot-classic/sqlparse.nix +++ b/krebs/5pkgs/simple/buildbot-classic/sqlparse.nix @@ -1,4 +1,4 @@ -{ stdenv +{ lib , buildPythonPackage , fetchPypi , pytest @@ -22,7 +22,7 @@ buildPythonPackage rec { # Package supports 3.x, but tests are clearly 2.x only. doCheck = !isPy3k; - meta = with stdenv.lib; { + meta = with lib; { description = "Non-validating SQL parser for Python"; longDescription = '' Provides support for parsing, splitting and formatting SQL statements. -- cgit v1.2.3 From 1630aafe6d64f56df49c0259962d78b5913e96af Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 19 Oct 2021 22:53:15 +0200 Subject: tv: stdenv.lib -> lib --- tv/5pkgs/haskell/mailaids.nix | 4 ++-- tv/5pkgs/haskell/th-env/default.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tv/5pkgs/haskell/mailaids.nix b/tv/5pkgs/haskell/mailaids.nix index b705c7c69..f152a76f4 100644 --- a/tv/5pkgs/haskell/mailaids.nix +++ b/tv/5pkgs/haskell/mailaids.nix @@ -1,6 +1,6 @@ { mkDerivation, aeson, aeson-pretty, base, bytestring , case-insensitive, fetchgit, lens, optparse-applicative -, purebred-email, stdenv, text, vector, word8 +, purebred-email, lib, text, vector, word8 }: mkDerivation { pname = "mailaids"; @@ -17,5 +17,5 @@ mkDerivation { aeson aeson-pretty base bytestring case-insensitive lens optparse-applicative purebred-email text vector word8 ]; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; } diff --git a/tv/5pkgs/haskell/th-env/default.nix b/tv/5pkgs/haskell/th-env/default.nix index 474a63b85..158fb165a 100644 --- a/tv/5pkgs/haskell/th-env/default.nix +++ b/tv/5pkgs/haskell/th-env/default.nix @@ -1,4 +1,4 @@ -{ mkDerivation, base, stdenv, template-haskell, text }: +{ mkDerivation, base, lib, template-haskell, text }: mkDerivation { pname = "th-env"; version = "1.0.0"; @@ -6,5 +6,5 @@ mkDerivation { libraryHaskellDepends = [ base template-haskell text ]; homepage = "https://stackoverflow.com/q/57635686"; license = "unknown"; - hydraPlatforms = stdenv.lib.platforms.none; + hydraPlatforms = lib.platforms.none; } -- cgit v1.2.3 From c5bab88a9e2b9a30ea148e5938a2110f44f18a5e Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 23 Oct 2021 12:07:40 +0200 Subject: tinc module: add group for user --- krebs/3modules/tinc.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index a8a78a43e..2c19aefdb 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -237,9 +237,14 @@ let inherit (cfg.user) home name uid; createHome = true; isSystemUser = true; + group = netname; } ) config.krebs.tinc; + users.groups = mapAttrs' (netname: cfg: + nameValuePair netname {} + ) config.krebs.tinc; + environment.etc = mapAttrs' (netname: cfg: nameValuePair "tinc/${netname}" (mkIf cfg.enableLegacy { source = cfg.confDir; -- cgit v1.2.3 From 1ea95b68f4cfeb85f4539a87797b120fca19e9d4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 23 Oct 2021 12:08:58 +0200 Subject: fetchWallpaper module: add group --- krebs/3modules/fetchWallpaper.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/krebs/3modules/fetchWallpaper.nix b/krebs/3modules/fetchWallpaper.nix index 852c8f630..dc0133a63 100644 --- a/krebs/3modules/fetchWallpaper.nix +++ b/krebs/3modules/fetchWallpaper.nix @@ -55,10 +55,12 @@ let name = "fetchWallpaper"; uid = genid_uint31 "fetchWallpaper"; description = "fetchWallpaper user"; + group = "fetchWallpaper"; home = cfg.stateDir; createHome = true; isSystemUser = true; }; + users.groups.fetchWallpaper = {}; systemd.timers.fetchWallpaper = { description = "fetch wallpaper timer"; -- cgit v1.2.3 From 9ea664b63c348a5855299250ec45f622c1404c5d Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 23 Oct 2021 12:13:53 +0200 Subject: l coaxmetal.r: use nixos-unstable --- lass/1systems/coaxmetal/source.nix | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 lass/1systems/coaxmetal/source.nix diff --git a/lass/1systems/coaxmetal/source.nix b/lass/1systems/coaxmetal/source.nix new file mode 100644 index 000000000..0e2628b5b --- /dev/null +++ b/lass/1systems/coaxmetal/source.nix @@ -0,0 +1,4 @@ +{ lib, pkgs, ... }: +{ + nixpkgs.git.ref = lib.mkForce (lib.importJSON ../../../krebs/nixpkgs-unstable.json).rev; +} -- cgit v1.2.3 From 55b137ba525f075f4619de4676d3e66f782b1a12 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 14 Sep 2021 18:52:54 +0200 Subject: rip Reaktor --- krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh | 6 --- krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh | 20 -------- krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py | 58 ---------------------- .../5pkgs/simple/Reaktor/scripts/shack-correct.sh | 6 --- 4 files changed, 90 deletions(-) delete mode 100755 krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh delete mode 100755 krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh delete mode 100755 krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py delete mode 100755 krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh b/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh deleted file mode 100755 index 6f3dd4a3f..000000000 --- a/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -curl -sS http://emojicons.com/random | \ - grep data-text | \ - sed -n 's/.*>\(.*\)<\/textarea>/\1/p' | \ - head -n 1 | \ - xmlstarlet unesc diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh b/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh deleted file mode 100755 index 5c47c6156..000000000 --- a/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/sh -set -eu -# requires env: -# $state_dir -# $origin - -# in PATH: git,lentil,coreutils -subdir=`echo "$1" | tr -dc "[:alnum:]"` -name=`echo "$origin" | tr -dc "[:alnum:]"` -track="$state_dir/$name-checkout" -(if test -e "$track" ;then - cd "$track" - git fetch origin master - git reset --hard origin/master -else - git clone "$origin" "$track" -fi) >&2 - -cd "$track" -lentil "${subdir:-.}" -f csv | sed 1d | shuf | head -1 diff --git a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py deleted file mode 100755 index 4925b25bb..000000000 --- a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python3 - -# Usage: -# _from=krebs state_dir=. python sed-plugin.py 'dick butt' -# _from=krebs state_dir=. python sed-plugin.py 's/t/l/g' -# > dick bull -import shelve -from os import environ -from os.path import join -from sys import argv -from time import sleep -import re - -# try to open the shelve file until it succeeds -while True: - try: - d = shelve.open( - join(environ['state_dir'], 'sed-plugin.shelve'), - writeback=True - ) - break - except: # noqa: E722 - sleep(0.2) -usr = environ['_from'] - - -def is_regex(line): - myre = re.compile(r'^s/(?:\\/|[^/])+/(?:\\/|[^/])*/[ig]?$') - return myre.match(line) - - -line = argv[1] - -if is_regex(line): - last = d.get(usr, None) - if last: - from subprocess import Popen, PIPE - p = Popen(['sed', line], stdin=PIPE, stdout=PIPE, stderr=PIPE) - so, se = p.communicate(bytes("{}\n".format(last), "UTF-8")) - if p.returncode: - print("something went wrong when trying to process your regex: {}".format(line.strip())) - ret = so.decode() - if len(ret) > 512: - print('message to long, skipped') - elif len(ret.split('\n')) > 5: - print('to many lines, skipped') - else: - if last.strip() != ret.strip(): - print("\x02{}\x02 meant: {}".format(usr, ret.strip())) - if ret: - d[usr] = ret - - else: - print("no last message") -else: - d[usr] = line - -d.close() diff --git a/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh b/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh deleted file mode 100755 index d500b3cb3..000000000 --- a/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh -set -eu -printf "Sie meinten wohl \"" -echo -n $@ | sed 's/Shack/shack/g' -echo "\" check out https://wiki.shackspace.de/project/logo_and_ci#name_ci" -echo "${_from}--" -- cgit v1.2.3 From fd37549f825fb042cf091b25cd665155b7f80716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 13 Oct 2021 16:01:43 +0200 Subject: mic92: add ryan & graham --- krebs/3modules/external/mic92.nix | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index 3ef693290..c3a0d42df 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -761,5 +761,55 @@ in { }; }; }; + + graham = { + owner = config.krebs.users.mic92; + nets = rec { + retiolum = { + addrs = [ + config.krebs.hosts.graham.nets.retiolum.ip4.addr + config.krebs.hosts.graham.nets.retiolum.ip6.addr + ]; + ip4.addr = "10.243.29.196"; + aliases = [ "graham.r" ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIIBCgKCAQEAtnM8VqFlEPLPYfKOZvN4kKklrVEyX4WewlqHO8vtxML9ND5BHCdn + UeRsThvbKVRqEvZLTAXKClZRYVr2IroHqfx0euTq3FYTUbNNQ4KgcFAfLKWoxGfK + HsQbYpS93/sUtmhRBGcgXPnEkE6yqvFBXxcmB1QqdmgYKdY2Gtikwrv/5hb4AlNe + /gyzKGtAKYogspLI6EpEwlD9CGDNIUPJ4uQ56gDhV/qtyMSE6X0igSSVZayDc+x1 + InPkH90xsa0/uXjYDnXNdMguLArGkRzMhd6DzK4vEaPFIX59yMX+tEj46rGY7xAI + gUZUI2codqY5Z93W5GC+ws34y0bpfeMMWwIDAQAB + -----END RSA PUBLIC KEY----- + Ed25519PublicKey = xMJNMMXZRCbWkN9CzLFohkGUK54dPcrrosFD7xgIFXA + ''; + }; + }; + }; + + ryan = { + owner = config.krebs.users.mic92; + nets = rec { + retiolum = { + addrs = [ + config.krebs.hosts.ryan.nets.retiolum.ip4.addr + config.krebs.hosts.ryan.nets.retiolum.ip6.addr + ]; + ip4.addr = "10.243.29.198"; + aliases = [ "ryan.r" ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIIBCgKCAQEA0RE5jmBiEGmaYLVFmpCyVvlb6K3Zh2uxh7sVm44k31d9PEHHm4Wz + HQH+ueaefGVu19xLRJQGu4ZMl7oRbb5awiqKdSGgInhQaNzxUIHW4cCCdOVkgZSy + NjI9LMcc8tQtkoFGt6OhAzaViuGMo+aJAkLuXNf8hz5uR2flqQEeKfG5Kc7Z1DAQ + QNoBRtY0pltyK2y/Ip8cZ9cdxR5oLww67ykhY+eLy9tZLfKs6uWSq+2CV0cpNNQ9 + Sh8fSbkjb4+JkxWAHDOyAnwFxnxstMcW0cscOW7nXYDi5IpvvesJlk698un7bLhm + vCkAd+WiNuTGfs9t0r6FDDVDREBhNk1sLwIDAQAB + -----END RSA PUBLIC KEY----- + Ed25519PublicKey = sOD149OLZ2yUEjRpwbGdwHULKF2qNY3F+9AsEi1G0ZM + ''; + }; + }; + }; }; } -- cgit v1.2.3 From 6d51da9202791651b98d3139260884b24ed6b8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 13 Oct 2021 19:51:31 +0200 Subject: mic92: non-colliding ip address for graham --- krebs/3modules/external/mic92.nix | 49 ++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index c3a0d42df..36f476db1 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -762,30 +762,6 @@ in { }; }; - graham = { - owner = config.krebs.users.mic92; - nets = rec { - retiolum = { - addrs = [ - config.krebs.hosts.graham.nets.retiolum.ip4.addr - config.krebs.hosts.graham.nets.retiolum.ip6.addr - ]; - ip4.addr = "10.243.29.196"; - aliases = [ "graham.r" ]; - tinc.pubkey = '' - -----BEGIN RSA PUBLIC KEY----- - MIIBCgKCAQEAtnM8VqFlEPLPYfKOZvN4kKklrVEyX4WewlqHO8vtxML9ND5BHCdn - UeRsThvbKVRqEvZLTAXKClZRYVr2IroHqfx0euTq3FYTUbNNQ4KgcFAfLKWoxGfK - HsQbYpS93/sUtmhRBGcgXPnEkE6yqvFBXxcmB1QqdmgYKdY2Gtikwrv/5hb4AlNe - /gyzKGtAKYogspLI6EpEwlD9CGDNIUPJ4uQ56gDhV/qtyMSE6X0igSSVZayDc+x1 - InPkH90xsa0/uXjYDnXNdMguLArGkRzMhd6DzK4vEaPFIX59yMX+tEj46rGY7xAI - gUZUI2codqY5Z93W5GC+ws34y0bpfeMMWwIDAQAB - -----END RSA PUBLIC KEY----- - Ed25519PublicKey = xMJNMMXZRCbWkN9CzLFohkGUK54dPcrrosFD7xgIFXA - ''; - }; - }; - }; ryan = { owner = config.krebs.users.mic92; @@ -811,5 +787,30 @@ in { }; }; }; + + graham = { + owner = config.krebs.users.mic92; + nets = rec { + retiolum = { + addrs = [ + config.krebs.hosts.graham.nets.retiolum.ip4.addr + config.krebs.hosts.graham.nets.retiolum.ip6.addr + ]; + ip4.addr = "10.243.29.199"; + aliases = [ "graham.r" ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIIBCgKCAQEAtnM8VqFlEPLPYfKOZvN4kKklrVEyX4WewlqHO8vtxML9ND5BHCdn + UeRsThvbKVRqEvZLTAXKClZRYVr2IroHqfx0euTq3FYTUbNNQ4KgcFAfLKWoxGfK + HsQbYpS93/sUtmhRBGcgXPnEkE6yqvFBXxcmB1QqdmgYKdY2Gtikwrv/5hb4AlNe + /gyzKGtAKYogspLI6EpEwlD9CGDNIUPJ4uQ56gDhV/qtyMSE6X0igSSVZayDc+x1 + InPkH90xsa0/uXjYDnXNdMguLArGkRzMhd6DzK4vEaPFIX59yMX+tEj46rGY7xAI + gUZUI2codqY5Z93W5GC+ws34y0bpfeMMWwIDAQAB + -----END RSA PUBLIC KEY----- + Ed25519PublicKey = xMJNMMXZRCbWkN9CzLFohkGUK54dPcrrosFD7xgIFXA + ''; + }; + }; + }; }; } -- cgit v1.2.3 From b13aaa3e6539a3b9c968e694d624baccf95157c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 14 Oct 2021 15:45:58 +0200 Subject: mic92: add maurice --- krebs/3modules/external/mic92.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index 36f476db1..ec76273a6 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -812,5 +812,29 @@ in { }; }; }; + + maurice = { + owner = config.krebs.users.mic92; + nets = rec { + retiolum = { + addrs = [ + config.krebs.hosts.graham.nets.retiolum.ip4.addr + config.krebs.hosts.graham.nets.retiolum.ip6.addr + ]; + ip4.addr = "10.243.29.200"; + aliases = [ "maurice.r" ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIIBCgKCAQEAsLKBfPtZkjWGu6uitCV+4c5aQox2t4N8XNhY2mqE806XsYrqAC+y + d0oLOxRMUjfh9stDnEW/YRoLEKz9oZdRYd4eenP0Q3c3HdRFDBNCs27M5a8ysqZD + 5w9+B+9OfUmMv61NyKiaR6WtoGbE849cj1UNk1z04elshfU7h829D8QnD4j1A1gf + bOaNG+RzOP6qP/6Q30rxAiTxRPi+FhcHvxa33y1ZVobvnfGcJa+AzsTbgH9T9Yob + GuXFZvuQVSyWOLOgY/vVml904q8gScMpBesAsZJ7DEXxSTga0Rt99Ti3d9ABwBI5 + 1YabQlGLaAkrj3PMgrDyayzGBDDDva9fEQIDAQAB + -----END RSA PUBLIC KEY----- + ''; + }; + }; + }; }; } -- cgit v1.2.3 From db9f0d97ec35cc4673bdb9b0fb8b922891400357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 14 Oct 2021 15:49:08 +0200 Subject: mic92: fix ips of maurice --- krebs/3modules/external/mic92.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index ec76273a6..c477eb6f1 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -818,8 +818,8 @@ in { nets = rec { retiolum = { addrs = [ - config.krebs.hosts.graham.nets.retiolum.ip4.addr - config.krebs.hosts.graham.nets.retiolum.ip6.addr + config.krebs.hosts.maurice.nets.retiolum.ip4.addr + config.krebs.hosts.maurice.nets.retiolum.ip6.addr ]; ip4.addr = "10.243.29.200"; aliases = [ "maurice.r" ]; -- cgit v1.2.3 From 04ec7f8e7deeed58ff687d609d5e24d56bb82645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 14 Oct 2021 16:08:20 +0200 Subject: mic92: add ed25519 for maurice --- krebs/3modules/external/mic92.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index c477eb6f1..1f67bdfa6 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -832,6 +832,7 @@ in { GuXFZvuQVSyWOLOgY/vVml904q8gScMpBesAsZJ7DEXxSTga0Rt99Ti3d9ABwBI5 1YabQlGLaAkrj3PMgrDyayzGBDDDva9fEQIDAQAB -----END RSA PUBLIC KEY----- + Ed25519PublicKey = pkMuJ4kbyleQAdau+sfmLtzTuUy7uL+wwcgV/GWC7/N ''; }; }; -- cgit v1.2.3 From 0564414a3184960555a8146f78b36120e6ef0c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 14 Oct 2021 17:32:22 +0200 Subject: mic92: add aenderpad --- krebs/3modules/external/mic92.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index 1f67bdfa6..b4e046303 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -256,6 +256,10 @@ in { okelmann = { owner = config.krebs.users.mic92; nets.retiolum = { + addrs = [ + config.krebs.hosts.okelmann.nets.retiolum.ip4.addr + config.krebs.hosts.okelmann.nets.retiolum.ip6.addr + ]; ip4.addr = "10.243.29.190"; aliases = [ "okelmann.r" @@ -275,6 +279,10 @@ in { aendernix = { owner = config.krebs.users.mic92; nets.retiolum = { + addrs = [ + config.krebs.hosts.aendernix.nets.retiolum.ip4.addr + config.krebs.hosts.aendernix.nets.retiolum.ip6.addr + ]; ip4.addr = "10.243.29.172"; aliases = [ "aendernix.r" @@ -296,6 +304,30 @@ in { ''; }; }; + aenderpad = { + owner = config.krebs.users.mic92; + nets.retiolum = { + addrs = [ + config.krebs.hosts.aenderpad.nets.retiolum.ip4.addr + config.krebs.hosts.aenderpad.nets.retiolum.ip6.addr + ]; + ip4.addr = "10.243.29.201"; + aliases = [ + "aendernix.r" + ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIIBCgKCAQEAvHSVUd6/5P2rK3s9iQhVrxkjufDIi0Kn04iVB4Z0TpUvnmFAP+Hv + d7umo95lNkAPL9c3byv4ooQjOskrp7GmgQRijLUvJSAZ9FBVWPAjMXs+gk9oJnQj + 6bovXJ3DurmW3h1ZRmkWn256j7g8lEMtf5LGFxs9Bwi4wqZTbI6DzTQhmNm76Spb + 2UMSzr9kDcNj5r6LDhDKEDtx4P1Opshgsf9AusV81N5nqDcvAYsvEqYoPvjKIPwF + 5jtfHY7hM7SdYoVgdAY8RFH7xuRkLQW4LBxPKjP3pEQPCgXcuEELm33PGr+w/vhC + jxeyKP+uSeuBBMSatTWG3kU8W2LxVML65QIDAQAB + -----END RSA PUBLIC KEY----- + Ed25519PublicKey = jC2UzKiUtWUlZF2ET88qM+Ot+GpoWxFFfpi8TCCr0uM + ''; + }; + }; dimitra = { owner = config.krebs.users.mic92; nets.retiolum = { -- cgit v1.2.3 From 679922a7831176089fe9e3ad62346b0e0bd4dcdd Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 23 Oct 2021 15:15:54 +0200 Subject: Revert "rip Reaktor" This reverts commit 55b137ba525f075f4619de4676d3e66f782b1a12. --- krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh | 6 +++ krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh | 20 ++++++++ krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py | 58 ++++++++++++++++++++++ .../5pkgs/simple/Reaktor/scripts/shack-correct.sh | 6 +++ 4 files changed, 90 insertions(+) create mode 100755 krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh create mode 100755 krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh create mode 100755 krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py create mode 100755 krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh b/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh new file mode 100755 index 000000000..6f3dd4a3f --- /dev/null +++ b/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh @@ -0,0 +1,6 @@ +#!/bin/sh +curl -sS http://emojicons.com/random | \ + grep data-text | \ + sed -n 's/.*>\(.*\)<\/textarea>/\1/p' | \ + head -n 1 | \ + xmlstarlet unesc diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh b/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh new file mode 100755 index 000000000..5c47c6156 --- /dev/null +++ b/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh @@ -0,0 +1,20 @@ +#! /bin/sh +set -eu +# requires env: +# $state_dir +# $origin + +# in PATH: git,lentil,coreutils +subdir=`echo "$1" | tr -dc "[:alnum:]"` +name=`echo "$origin" | tr -dc "[:alnum:]"` +track="$state_dir/$name-checkout" +(if test -e "$track" ;then + cd "$track" + git fetch origin master + git reset --hard origin/master +else + git clone "$origin" "$track" +fi) >&2 + +cd "$track" +lentil "${subdir:-.}" -f csv | sed 1d | shuf | head -1 diff --git a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py new file mode 100755 index 000000000..4925b25bb --- /dev/null +++ b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 + +# Usage: +# _from=krebs state_dir=. python sed-plugin.py 'dick butt' +# _from=krebs state_dir=. python sed-plugin.py 's/t/l/g' +# > dick bull +import shelve +from os import environ +from os.path import join +from sys import argv +from time import sleep +import re + +# try to open the shelve file until it succeeds +while True: + try: + d = shelve.open( + join(environ['state_dir'], 'sed-plugin.shelve'), + writeback=True + ) + break + except: # noqa: E722 + sleep(0.2) +usr = environ['_from'] + + +def is_regex(line): + myre = re.compile(r'^s/(?:\\/|[^/])+/(?:\\/|[^/])*/[ig]?$') + return myre.match(line) + + +line =