From f558f1bc0c779cc310ff8a712d4f178db73de6ef Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:11:38 +0200
Subject: [PATCH 01/30] *: set isSystemUser or isNormalUser

This is a requirement for nixpkgs 21.05, or else evaluation will fail
with:

Exactly one of users.users.${name}.isSystemUser and users.users.${name}.isNormalUser must be set.
---
 krebs/3modules/exim.nix  | 1 +
 krebs/3modules/git.nix   | 2 ++
 krebs/3modules/htgen.nix | 1 +
 krebs/3modules/tinc.nix  | 1 +
 tv/2configs/pulse.nix    | 1 +
 5 files changed, 6 insertions(+)

diff --git a/krebs/3modules/exim.nix b/krebs/3modules/exim.nix
index 83d88cb0d..972c7f437 100644
--- a/krebs/3modules/exim.nix
+++ b/krebs/3modules/exim.nix
@@ -78,6 +78,7 @@ in {
         inherit (cfg.user) home name uid;
         createHome = true;
         group = cfg.group.name;
+        isSystemUser = true;
       };
     };
   };
diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix
index 4eb881341..d31d91b7c 100644
--- a/krebs/3modules/git.nix
+++ b/krebs/3modules/git.nix
@@ -366,6 +366,7 @@ let
         # To allow running cgit-clear-cache via hooks.
         cfg.cgit.fcgiwrap.group.name
       ];
+      isSystemUser = true;
       shell = "/bin/sh";
       openssh.authorizedKeys.keys =
         unique
@@ -384,6 +385,7 @@ let
       users.${cfg.cgit.fcgiwrap.user.name} = {
         inherit (cfg.cgit.fcgiwrap.user) home name uid;
         group = cfg.cgit.fcgiwrap.group.name;
+        isSystemUser = true;
       };
     };
 
diff --git a/krebs/3modules/htgen.nix b/krebs/3modules/htgen.nix
index 70c4fcd2b..063bccc68 100644
--- a/krebs/3modules/htgen.nix
+++ b/krebs/3modules/htgen.nix
@@ -66,6 +66,7 @@ let
       nameValuePair htgen.user.name {
         inherit (htgen.user) home name uid;
         createHome = true;
+        isSystemUser = true;
       }
     ) cfg;
 
diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix
index 4252c8d3b..a8a78a43e 100644
--- a/krebs/3modules/tinc.nix
+++ b/krebs/3modules/tinc.nix
@@ -236,6 +236,7 @@ let
       nameValuePair "${netname}" {
         inherit (cfg.user) home name uid;
         createHome = true;
+        isSystemUser = true;
       }
     ) config.krebs.tinc;
 
diff --git a/tv/2configs/pulse.nix b/tv/2configs/pulse.nix
index 79c31e9ec..f720ad473 100644
--- a/tv/2configs/pulse.nix
+++ b/tv/2configs/pulse.nix
@@ -116,6 +116,7 @@ in
       group = "pulse";
       extraGroups = [ "audio" ];
       home = "${runDir}/home";
+      isSystemUser = true;
     };
   };
 }

From ef24dd03e1b67353b23227f85aded6f007d23a09 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:13:33 +0200
Subject: [PATCH 02/30] tv: remove security.hideProcessInformation

It's broken in nixpkgs 21.05
---
 tv/2configs/default.nix | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix
index 07e7ff11d..19e191b7b 100644
--- a/tv/2configs/default.nix
+++ b/tv/2configs/default.nix
@@ -38,7 +38,6 @@ with import <stockholm/lib>;
     }
     {
       i18n.defaultLocale = mkDefault "C.UTF-8";
-      security.hideProcessInformation = true;
       security.sudo.extraConfig = ''
         Defaults env_keep+="SSH_CLIENT XMONAD_SPAWN_WORKSPACE"
         Defaults mailto="${config.krebs.users.tv.mail}"

From 539fb1f899cdd1924ffd6a7e9547a3728f602057 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:40:51 +0200
Subject: [PATCH 03/30] tv gitrepos: use python3 for markdown2

For nixpkgs 21.05
---
 tv/2configs/gitrepos.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tv/2configs/gitrepos.nix b/tv/2configs/gitrepos.nix
index 2e73640ff..1586f3b33 100644
--- a/tv/2configs/gitrepos.nix
+++ b/tv/2configs/gitrepos.nix
@@ -33,7 +33,7 @@ let {
       cgit = {
         settings = {
           about-filter = pkgs.exec "krebs.cgit.about-filter" rec {
-            filename = "${pkgs.pythonPackages.markdown2}/bin/markdown2";
+            filename = "${pkgs.python3Packages.markdown2}/bin/markdown2";
             argv = [
               filename
               "--extras=fenced-code-blocks"

From f0660185cb669fa8635653904ccef27f3fe2cb45 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:15:33 +0200
Subject: [PATCH 04/30] tv overrides input-fonts: use fetchzip

---
 tv/5pkgs/override/default.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix
index e6aae0f26..3f76a4c6e 100644
--- a/tv/5pkgs/override/default.nix
+++ b/tv/5pkgs/override/default.nix
@@ -8,10 +8,12 @@ self: super: {
     '';
   });
   input-fonts = super.input-fonts.overrideAttrs (old: rec {
-    src = self.fetchurl {
+    src = self.fetchzip {
       url = "http://xu.r/~tv/mirrors/input-fonts/Input-Font-2.zip";
-      sha256 = "1vvipqcflz4ximy7xpqy9idrdpq3a0c490hp5137r2dq03h865y0";
+      sha256 = "1q58x92nm7dk9ylp09pvgj74nxkywvqny3xmfighnsl30dv42fcr";
+      stripRoot = false;
     };
+    sourceRoot = null;
     outputHash = null;
     outputHashAlgo = null;
     outputHashMode = null;

From 1132a21b94423535a75ee80daafc8afd7a43d30b Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:18:10 +0200
Subject: [PATCH 05/30] tv fzf: allow unset patchPhase

For nixpkgs 21.05
---
 tv/5pkgs/override/default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix
index 3f76a4c6e..4fb2e8061 100644
--- a/tv/5pkgs/override/default.nix
+++ b/tv/5pkgs/override/default.nix
@@ -4,7 +4,7 @@ self: super: {
     # XXX cannot use `patches` because fzf has a custom patchPhase
     patchPhase = ''
       patch -Np1 < ${./fzf.complete1.patch}
-      ${old.patchPhase}
+      ${old.patchPhase or ""}
     '';
   });
   input-fonts = super.input-fonts.overrideAttrs (old: rec {

From 6b8c4dbe8cdc46f17cfa0cb7c8cd7f7c7bd4d1d2 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:21:51 +0200
Subject: [PATCH 06/30] tv utsushi: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 tv/5pkgs/simple/utsushi.nix | 40 +++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/tv/5pkgs/simple/utsushi.nix b/tv/5pkgs/simple/utsushi.nix
index 0414eae09..678cdc56c 100644
--- a/tv/5pkgs/simple/utsushi.nix
+++ b/tv/5pkgs/simple/utsushi.nix
@@ -1,4 +1,6 @@
-{ boost, fetchurl, file, imagemagick, libudev, libusb, pkgconfig, stdenv
+{ fetchurl, lib, stdenv
+
+, boost, file, imagemagick, libudev, libusb, pkgconfig
 , coreutils, dash, patchelf, writeScriptBin # for add-rpath
 
 , guiSupport ? false, gtkmm2 ? null
@@ -81,7 +83,7 @@ let
 
     preFixup = ''
       patchelf --set-interpreter \
-          ${stdenv.glibc}/lib/ld-linux${stdenv.lib.optionalString stdenv.is64bit "-x86-64"}.so.2 \
+          ${stdenv.glibc}/lib/ld-linux${lib.optionalString stdenv.is64bit "-x86-64"}.so.2 \
           $out/lib/utsushi/networkscan
 
       # libstdc++.so.6
@@ -96,9 +98,9 @@ let
         Image Scan v3 scanner driver bundle, which can be used by Utsushi.
       '';
       homepage = "http://support.epson.net/linux/en/imagescanv3.php?version=${version}";
-      license = stdenv.lib.licenses.eapl;
-      maintainers = [ stdenv.lib.maintainers.tv ];
-      platforms = stdenv.lib.platforms.linux;
+      license = lib.licenses.eapl;
+      maintainers = [ lib.maintainers.tv ];
+      platforms = lib.platforms.linux;
     };
   };
 
@@ -129,7 +131,7 @@ stdenv.mkDerivation rec {
     # Allow configuration to be done via /etc/utsushi.conf
     ln -s /etc/utsushi.conf $out/etc/utsushi/utsushi.conf
 
-    ${stdenv.lib.optionalString saneSupport ''
+    ${lib.optionalString saneSupport ''
       # Make this package compatible with hardware.sane.extraBackends
       mkdir $out/etc/sane.d
       echo utsushi > $out/etc/sane.d/dll.conf
@@ -137,7 +139,7 @@ stdenv.mkDerivation rec {
       ln -s $out/lib/utsushi/sane/libsane-utsushi.* $out/lib/sane
     ''}
 
-    ${stdenv.lib.optionalString networkSupport ''
+    ${lib.optionalString networkSupport ''
       ln -s ${imagescan-plugin-networkscan}/lib/utsushi/networkscan \
         $out/libexec/utsushi/
     ''}
@@ -151,7 +153,7 @@ stdenv.mkDerivation rec {
   #
   preFixup = ''
     add-rpath ${boost}/lib $out/lib/utsushi/libdrv-esci.so
-    ${stdenv.lib.optionalString saneSupport ''
+    ${lib.optionalString saneSupport ''
       add-rpath ${boost}/lib $out/lib/utsushi/sane/libsane-utsushi.so
     ''}
   '';
@@ -167,10 +169,10 @@ stdenv.mkDerivation rec {
     libudev
     libusb
   ]
-  ++ stdenv.lib.optional guiSupport gtkmm2
-  ++ stdenv.lib.optional ocrSupport tesseract
-  ++ stdenv.lib.optional saneSupport saneBackends
-  ++ stdenv.lib.optional tiffSupport libtiff
+  ++ lib.optional guiSupport gtkmm2
+  ++ lib.optional ocrSupport tesseract
+  ++ lib.optional saneSupport saneBackends
+  ++ lib.optional tiffSupport libtiff
   ;
 
   NIX_CFLAGS_COMPILE = [
@@ -184,16 +186,16 @@ stdenv.mkDerivation rec {
     "--with-magick-pp"
     "--with-udev-confdir=$(out)/etc/udev"
   ]
-  ++ stdenv.lib.optionals guiSupport [
+  ++ lib.optionals guiSupport [
     "--with-gtkmm"
   ]
-  ++ stdenv.lib.optionals jpegSupport [
+  ++ lib.optionals jpegSupport [
     "--with-jpeg"
   ]
-  ++ stdenv.lib.optionals saneSupport [
+  ++ lib.optionals saneSupport [
     "--with-sane"
   ]
-  ++ stdenv.lib.optionals tiffSupport [
+  ++ lib.optionals tiffSupport [
     "--with-tiff"
   ]
   ;
@@ -210,8 +212,8 @@ stdenv.mkDerivation rec {
       around the SANE standard.
     '';
     homepage = http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX;
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.tv ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.tv ];
+    platforms = lib.platforms.linux;
   };
 }

From 291dabd3d7fb1ac90b62889c1e54354ad49efd3a Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:23:55 +0200
Subject: [PATCH 07/30] tv 433Utils: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 tv/5pkgs/rpi/433Utils/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tv/5pkgs/rpi/433Utils/default.nix b/tv/5pkgs/rpi/433Utils/default.nix
index 78be6de35..136e3dbca 100644
--- a/tv/5pkgs/rpi/433Utils/default.nix
+++ b/tv/5pkgs/rpi/433Utils/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv
+{ fetchFromGitHub, lib, stdenv
 , wiringPi ? WiringPi.wiringPi
 , wiringPiDev ? WiringPi.wiringPiDev
 , WiringPi ? rpiPackages.WiringPi
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   pname = "433Utils-RPi_utils";
   version = "2018-06-07";
 
-  src = fetchFromGitHub (stdenv.lib.importJSON ./src.json);
+  src = fetchFromGitHub (lib.importJSON ./src.json);
 
   patches = [
     ./rc-switch.protocols.patch

From d91cf6bfaa62255db5885f078dddfcc29d484a97 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:24:34 +0200
Subject: [PATCH 08/30] tv WiringPi: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 tv/5pkgs/rpi/WiringPi/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tv/5pkgs/rpi/WiringPi/default.nix b/tv/5pkgs/rpi/WiringPi/default.nix
index 61c43556d..40fcaeae4 100644
--- a/tv/5pkgs/rpi/WiringPi/default.nix
+++ b/tv/5pkgs/rpi/WiringPi/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, runCommand, stdenv }:
+{ fetchFromGitHub, lib, runCommand, stdenv }:
 
 let
   generic = name: extraAttrs:
@@ -6,7 +6,7 @@ let
       pname = "WiringPi-${name}";
       version = "2020-09-14";
 
-      src = fetchFromGitHub (stdenv.lib.importJSON ./src.json);
+      src = fetchFromGitHub (lib.importJSON ./src.json);
 
       buildPhase = ''
         runHook postBuild

From 4297b6b3bdee73c24903f6c3150436cd1213e92d Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:26:03 +0200
Subject: [PATCH 09/30] tv diff-so-fancy: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 tv/5pkgs/simple/diff-so-fancy.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tv/5pkgs/simple/diff-so-fancy.nix b/tv/5pkgs/simple/diff-so-fancy.nix
index 9ce6d9234..d57e6e75c 100644
--- a/tv/5pkgs/simple/diff-so-fancy.nix
+++ b/tv/5pkgs/simple/diff-so-fancy.nix
@@ -1,4 +1,6 @@
-{stdenv, git, perl, ncurses, coreutils, fetchFromGitHub, makeWrapper, ...}:
+{ fetchFromGitHub, lib, stdenv
+, coreutils, git, makeWrapper, ncurses, perl
+}:
 
 stdenv.mkDerivation rec {
   name = "diff-so-fancy-${version}";
@@ -34,7 +36,7 @@ stdenv.mkDerivation rec {
       --prefix PATH : "${ncurses.out}/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = https://github.com/so-fancy/diff-so-fancy;
     description = "Good-looking diffs filter for git";
     license = licenses.mit;

From ea902ce405d6ed0e8160bc46d8a03344d1ae3094 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:27:17 +0200
Subject: [PATCH 10/30] tv fzmenu: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 tv/5pkgs/simple/fzmenu/default.nix | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tv/5pkgs/simple/fzmenu/default.nix b/tv/5pkgs/simple/fzmenu/default.nix
index 35918ff77..1f1b82848 100644
--- a/tv/5pkgs/simple/fzmenu/default.nix
+++ b/tv/5pkgs/simple/fzmenu/default.nix
@@ -1,4 +1,7 @@
-{ coreutils, dash, gnused, fzf, pass-otp, runCommand, rxvt_unicode, stdenv, utillinux, xdotool }:
+{ lib, stdenv
+, runCommand
+, coreutils, dash, gnused, fzf, pass-otp, rxvt_unicode, utillinux, xdotool
+}:
 
 runCommand "fzmenu" {
 } /* sh */ ''
@@ -8,7 +11,7 @@ runCommand "fzmenu" {
 
   substituteInPlace $out/bin/otpmenu \
       --replace '#! /bin/sh' '#! ${dash}/bin/dash' \
-      --replace '#PATH=' PATH=${stdenv.lib.makeBinPath [
+      --replace '#PATH=' PATH=${lib.makeBinPath [
         coreutils
         dash
         fzf
@@ -21,7 +24,7 @@ runCommand "fzmenu" {
 
   substituteInPlace $out/bin/passmenu \
       --replace '#! /bin/sh' '#! ${dash}/bin/dash' \
-      --replace '#PATH=' PATH=${stdenv.lib.makeBinPath [
+      --replace '#PATH=' PATH=${lib.makeBinPath [
         coreutils
         dash
         fzf

From 124925bb780bbfdbf3578ad772ea75dbae437242 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:28:38 +0200
Subject: [PATCH 11/30] tv hc: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 tv/5pkgs/simple/hc.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tv/5pkgs/simple/hc.nix b/tv/5pkgs/simple/hc.nix
index 4d325e16c..086445ec0 100644
--- a/tv/5pkgs/simple/hc.nix
+++ b/tv/5pkgs/simple/hc.nix
@@ -1,4 +1,6 @@
-{ coreutils, fetchgit, findutils, gawk, gnugrep, makeWrapper, qrencode, stdenv, texlive, utillinux, zbar }:
+{ fetchgit, lib, makeWrapper, stdenv
+, coreutils, findutils, gawk, gnugrep, qrencode, texlive, utillinux, zbar
+}:
 
 stdenv.mkDerivation rec {
   name = "hc-${meta.version}";
@@ -19,7 +21,7 @@ stdenv.mkDerivation rec {
     cp $src/bin/hc $out/bin/hc
 
     wrapProgram $out/bin/hc \
-      --prefix PATH : ${stdenv.lib.makeBinPath [
+      --prefix PATH : ${lib.makeBinPath [
         coreutils
         findutils
         gawk

From 1462d2e534525792b300136d0071d665db03df86 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:29:38 +0200
Subject: [PATCH 12/30] tv rox-filer: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 tv/5pkgs/simple/rox-filer.nix | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tv/5pkgs/simple/rox-filer.nix b/tv/5pkgs/simple/rox-filer.nix
index bce89cacd..b380bdff9 100644
--- a/tv/5pkgs/simple/rox-filer.nix
+++ b/tv/5pkgs/simple/rox-filer.nix
@@ -1,4 +1,5 @@
-{ autoconf, stdenv, fetchFromGitLab, pkgconfig, libxml2, libSM, shared-mime-info
+{ fetchFromGitLab, lib, stdenv
+, autoconf, pkgconfig, libxml2, libSM, shared-mime-info
 , libxslt, docbook_xml_dtd_412, docbook_xsl
 , gtk ? gtk2, gtk2
 }:
@@ -84,7 +85,7 @@ stdenv.mkDerivation {
     ln -sv application-{msword,rtf}.png
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fast, lightweight, gtk2 file manager";
     homepage = "http://rox.sourceforge.net/desktop";
     license = with licenses; [ gpl2 lgpl2 ];

From 24aa4fc14673adfd419e7219eebfb0eb39c19ce4 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:30:39 +0200
Subject: [PATCH 13/30] shack/worlddomination: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/2configs/shack/worlddomination.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/krebs/2configs/shack/worlddomination.nix b/krebs/2configs/shack/worlddomination.nix
index 61b72d9a8..4bdb095f1 100644
--- a/krebs/2configs/shack/worlddomination.nix
+++ b/krebs/2configs/shack/worlddomination.nix
@@ -58,7 +58,7 @@ let
       src = pkgs.fetchurl { url = "https://pypi.python.org/packages/9c/f6/d839e4b14258d76e74a39810829c13f8dd31de2bfe0915579b2a609d1bbe/aiocoap-0.3.tar.gz"; sha256 = "402d4151db6d8d0b1d66af5b6e10e0de1521decbf12140637e5b8d2aa9c5aef6"; };
       propagatedBuildInputs = [ ];
       doCheck = false; # 2 errors, dunnolol
-      meta = with pkgs.stdenv.lib; {
+      meta = with pkgs.lib; {
         homepage = "";
         license = licenses.mit;
         description = "Python CoAP library";
@@ -68,7 +68,7 @@ let
     name = "LinkHeader-0.4.3";
     src = pkgs.fetchurl { url = "https://files.pythonhosted.org/packages/27/d4/eb1da743b2dc825e936ef1d9e04356b5701e3a9ea022c7aaffdf4f6b0594/LinkHeader-0.4.3.tar.gz"; sha256 = "7fbbc35c0ba3fbbc530571db7e1c886e7db3d718b29b345848ac9686f21b50c3"; };
     propagatedBuildInputs = [ ];
-    meta = with pkgs.stdenv.lib; {
+    meta = with pkgs.lib; {
       homepage = "";
       license = licenses.bsdOriginal;
       description = "Parse and format link headers according to RFC 5988 \"Web Linking\"";

From 6106fe993d5b23ab3ab2b40ea49ae22932d1c00a Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:32:57 +0200
Subject: [PATCH 14/30] airdcpp-webclient: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/airdcpp-webclient/default.nix | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/airdcpp-webclient/default.nix b/krebs/5pkgs/simple/airdcpp-webclient/default.nix
index 2bc6cdca9..754fecf9c 100644
--- a/krebs/5pkgs/simple/airdcpp-webclient/default.nix
+++ b/krebs/5pkgs/simple/airdcpp-webclient/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, makeWrapper, which
+{ fetchurl, lib, makeWrapper, stdenv
+, which
 }:
 stdenv.mkDerivation rec {
   name = "airdcpp-webclient-${version}";
@@ -17,7 +18,7 @@ stdenv.mkDerivation rec {
   '';
   nativeBuildInputs = [ makeWrapper ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     # to start it: airdcpp -p=<pid-file> -c=<config-store-path (must be writeable)> --configure
     description = "dcpp client (statically precompiled)";
     homepage = http://fixme;

From 4ec068373a0fba511a3ebddad35fac9e5a4c4ced Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:33:55 +0200
Subject: [PATCH 15/30] cac-api: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/cac-api/default.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/cac-api/default.nix b/krebs/5pkgs/simple/cac-api/default.nix
index e2bd8c148..5f37f6682 100644
--- a/krebs/5pkgs/simple/cac-api/default.nix
+++ b/krebs/5pkgs/simple/cac-api/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchgit, bc, cac-cert, coreutils, curl, dash, gnugrep, gnused, inotifyTools, jq, ncurses, openssh, sshpass, ... }:
+{ fetchgit, lib, stdenv
+, bc, cac-cert, coreutils, curl, dash, gnugrep, gnused, inotifyTools, jq, ncurses, openssh, sshpass
+}:
 
 stdenv.mkDerivation {
   name = "cac-api-1.1.2";
@@ -18,7 +20,7 @@ stdenv.mkDerivation {
     mkdir -p $out/bin
     { cat <<\EOF
     #! ${dash}/bin/dash
-    export PATH=${stdenv.lib.makeBinPath [
+    export PATH=${lib.makeBinPath [
       bc
       coreutils
       curl

From 51b94e51008ee17ee5e4754e451083fc1d31bcd6 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 00:34:31 +0200
Subject: [PATCH 16/30] dic: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/dic/default.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/dic/default.nix b/krebs/5pkgs/simple/dic/default.nix
index a74899630..1825e4ee7 100644
--- a/krebs/5pkgs/simple/dic/default.nix
+++ b/krebs/5pkgs/simple/dic/default.nix
@@ -1,4 +1,6 @@
-{ coreutils, curl, fetchgit, gnugrep, gnused, stdenv, utillinux }:
+{ fetchgit, lib, stdenv
+, coreutils, curl, gnugrep, gnused, utillinux
+}:
 
 stdenv.mkDerivation {
   name = "dic";
@@ -16,7 +18,7 @@ stdenv.mkDerivation {
 
   installPhase =
     let
-      path = stdenv.lib.makeBinPath [
+      path = lib.makeBinPath [
         coreutils
         curl
         gnused

From ad49be2ed59d45295321227a8619514ea5186e0f Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:17:34 +0200
Subject: [PATCH 17/30] drivedroid-gen-repo: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/drivedroid-gen-repo/default.nix | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/krebs/5pkgs/simple/drivedroid-gen-repo/default.nix b/krebs/5pkgs/simple/drivedroid-gen-repo/default.nix
index de8046c4a..dee96d784 100644
--- a/krebs/5pkgs/simple/drivedroid-gen-repo/default.nix
+++ b/krebs/5pkgs/simple/drivedroid-gen-repo/default.nix
@@ -1,10 +1,10 @@
-{stdenv,fetchurl,pkgs,python3Packages, ... }:
+{ fetchurl, lib, stdenv, python3Packages }:
 
 python3Packages.buildPythonPackage rec {
   name = "drivedroid-gen-repo-${version}";
   version = "0.4.4";
 
-  propagatedBuildInputs = with pkgs;[
+  propagatedBuildInputs = [
     python3Packages.docopt
   ];
 
@@ -16,7 +16,7 @@ python3Packages.buildPythonPackage rec {
   meta = {
     homepage = http://krebsco.de/;
     description = "Generate Drivedroid repos";
-    license = stdenv.lib.licenses.wtfpl;
+    license = lib.licenses.wtfpl;
   };
 }
 

From 935355a0af2717e1ba07cf55f530ec3e36a45cfd Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:18:07 +0200
Subject: [PATCH 18/30] ftb: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/ftb/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/ftb/default.nix b/krebs/5pkgs/simple/ftb/default.nix
index ab7d6e651..8007eaa52 100644
--- a/krebs/5pkgs/simple/ftb/default.nix
+++ b/krebs/5pkgs/simple/ftb/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl
+{ fetchurl, lib, stdenv
 , jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
 , openjdk
 , mesa_glu, openal
 , useAlsa ? false, alsaOss ? null }:
-with stdenv.lib;
+with lib;
 
 assert useAlsa -> alsaOss != null;
 

From b6aac83d6ea510a4de3476626ee7190c72156137 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:18:49 +0200
Subject: [PATCH 19/30] get: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/get/default.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/get/default.nix b/krebs/5pkgs/simple/get/default.nix
index 83f6b0228..5c024a00d 100644
--- a/krebs/5pkgs/simple/get/default.nix
+++ b/krebs/5pkgs/simple/get/default.nix
@@ -1,4 +1,6 @@
-{ coreutils, gnugrep, gnused, fetchgit, jq, nix, stdenv, ... }:
+{ fetchgit, lib, stdenv
+, coreutils, gnugrep, gnused, jq, nix
+}:
 
 stdenv.mkDerivation {
   name = "get-1.4.1";
@@ -16,7 +18,7 @@ stdenv.mkDerivation {
 
   installPhase =
     let
-      path = stdenv.lib.makeBinPath [
+      path = lib.makeBinPath [
         coreutils
         gnugrep
         gnused

From edb81b99e641e6bdb3947b1ff2c682caca8f24c2 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:19:18 +0200
Subject: [PATCH 20/30] github-hosts-sync: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/github-hosts-sync/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/github-hosts-sync/default.nix b/krebs/5pkgs/simple/github-hosts-sync/default.nix
index fbc48fa3f..60dd58ee7 100644
--- a/krebs/5pkgs/simple/github-hosts-sync/default.nix
+++ b/krebs/5pkgs/simple/github-hosts-sync/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, stdenv, ... }:
+{ lib, pkgs, stdenv }:
 
 stdenv.mkDerivation rec {
   name = "github-hosts-sync-${version}";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   installPhase = let
     ca-bundle = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
-    path = stdenv.lib.makeBinPath [
+    path = lib.makeBinPath [
       pkgs.git
       pkgs.nettools
       pkgs.openssh

From e5aafcc72305dda83e879721cd1678cdc5816597 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:19:52 +0200
Subject: [PATCH 21/30] internetarchive: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/internetarchive/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/internetarchive/default.nix b/krebs/5pkgs/simple/internetarchive/default.nix
index 3c83093be..dfe93befd 100644
--- a/krebs/5pkgs/simple/internetarchive/default.nix
+++ b/krebs/5pkgs/simple/internetarchive/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgs, ... }:
+{ lib, pkgs, stdenv, pkgs }:
 with pkgs.python3Packages;
 buildPythonPackage rec {
   pname = "internetarchive";
@@ -32,7 +32,7 @@ buildPythonPackage rec {
     sed -i "s/'schema.*'/'schema>=0.4.0'/" setup.py
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "python library and cli for uploading files to internet archive";
     license = licenses.agpl3;
   };

From 7867885f3918b18c5254a596d63ec8f612fdadfa Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:20:36 +0200
Subject: [PATCH 22/30] passwdqc-utils: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/passwdqc-utils/default.nix | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/krebs/5pkgs/simple/passwdqc-utils/default.nix b/krebs/5pkgs/simple/passwdqc-utils/default.nix
index 53e7f5482..4cc8d5b21 100644
--- a/krebs/5pkgs/simple/passwdqc-utils/default.nix
+++ b/krebs/5pkgs/simple/passwdqc-utils/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, pam,
-  fetchurl, lib,
-  wordset-file ? null, # set your own wordset-file
-  ... }:
+{ fetchurl, lib, stdenv
+, pam
+, wordset-file ? null, # set your own wordset-file
+}:
 
 stdenv.mkDerivation rec {
   name = "passwdqc-utils-${version}";
@@ -30,8 +30,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "passwdqc utils (pwqgen,pwqcheck) and library";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.makefu ];
-    patforms = stdenv.lib.platforms.linux; # more installFlags must be set for Darwin,Solaris
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.makefu ];
+    patforms = lib.platforms.linux; # more installFlags must be set for Darwin,Solaris
   };
 }

From 7ea3136475c614d0b717f86f696dc7e414c30adf Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:30:52 +0200
Subject: [PATCH 23/30] populate: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/populate/default.nix | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/populate/default.nix b/krebs/5pkgs/simple/populate/default.nix
index e35423b49..ef9ff04bf 100644
--- a/krebs/5pkgs/simple/populate/default.nix
+++ b/krebs/5pkgs/simple/populate/default.nix
@@ -1,8 +1,9 @@
-{ coreutils, fetchgit, findutils, git, gnused, jq, openssh, pass, rsync, stdenv
+{ fetchgit, lib, stdenv
+, coreutils, findutils, git, gnused, jq, openssh, pass, rsync
 }:
 
 let
-  PATH = stdenv.lib.makeBinPath [
+  PATH = lib.makeBinPath [
     coreutils
     findutils
     git

From cb11e10d956d520bd724d427ae63832243b7f431 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:32:00 +0200
Subject: [PATCH 24/30] slog: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/slog/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/slog/default.nix b/krebs/5pkgs/simple/slog/default.nix
index c74a2ad80..bd10bac5e 100644
--- a/krebs/5pkgs/simple/slog/default.nix
+++ b/krebs/5pkgs/simple/slog/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, stdenv, fetchFromGitHub }:
+{ fetchFromGitHub, lib, pkgs, stdenv }:
 
 ## use with:
 # . $(command -v slog.sh)
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     install -m755 slog.sh $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "POSIX shell logging";
     license = licenses.mit;
   };

From 842bb7a98ad8b7cca3b64554fb44b7d355910456 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:32:40 +0200
Subject: [PATCH 25/30] ssh-audit: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/ssh-audit.nix | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/krebs/5pkgs/simple/ssh-audit.nix b/krebs/5pkgs/simple/ssh-audit.nix
index 7d2e6fb34..4574eb644 100644
--- a/krebs/5pkgs/simple/ssh-audit.nix
+++ b/krebs/5pkgs/simple/ssh-audit.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, python3Packages, stdenv }:
+{ fetchFromGitHub, lib, python3Packages, stdenv }:
 
 python3Packages.buildPythonPackage rec {
   inherit (meta) version;
@@ -46,9 +46,9 @@ python3Packages.buildPythonPackage rec {
   meta = {
     description = "tool for ssh server auditing";
     homepage = "https://github.com/arthepsy/ssh-audit";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
     maintainers = [
-      stdenv.lib.maintainers.tv
+      lib.maintainers.tv
     ];
     version = "1.7.0";
   };

From 5b83edb2a526b35f4814d71701a52fe8bf0eff76 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:33:24 +0200
Subject: [PATCH 26/30] tinc_graphs: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/tinc_graphs/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/tinc_graphs/default.nix b/krebs/5pkgs/simple/tinc_graphs/default.nix
index 025e85df0..d281c9b50 100644
--- a/krebs/5pkgs/simple/tinc_graphs/default.nix
+++ b/krebs/5pkgs/simple/tinc_graphs/default.nix
@@ -1,4 +1,4 @@
-{stdenv,fetchurl,pkgs,python3Packages, ... }:
+{ fetchurl, lib, pkgs, python3Packages, stdenv }:
 
 python3Packages.buildPythonPackage rec {
   name = "tinc_graphs-${version}";
@@ -22,7 +22,7 @@ python3Packages.buildPythonPackage rec {
   meta = {
     homepage = http://krebsco.de/;
     description = "Create Graphs from Tinc Stats";
-    license = stdenv.lib.licenses.wtfpl;
+    license = lib.licenses.wtfpl;
   };
 }
 

From 7e045768bf86f31ecbfd5c5e5289d582632002a8 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:34:03 +0200
Subject: [PATCH 27/30] translate-shell: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/translate-shell/default.nix | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/krebs/5pkgs/simple/translate-shell/default.nix b/krebs/5pkgs/simple/translate-shell/default.nix
index 00ab226e5..cd698a2bd 100644
--- a/krebs/5pkgs/simple/translate-shell/default.nix
+++ b/krebs/5pkgs/simple/translate-shell/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl,pkgs,... }:
+{ fetchurl, lib, pkgs, stdenv }:
 let
   s =
   rec {
@@ -8,7 +8,7 @@ let
     url=https://github.com/soimort/translate-shell/archive/v0.9.0.9.tar.gz;
     sha256="1269j4yr9dr1d8c5kmysbzfplbgdg8apqnzs5w57d29sd7gz2i34";
   };
-  searchpath = with pkgs; stdenv.lib.makeSearchPath "bin" [
+  searchpath = with pkgs; lib.makeSearchPath "bin" [
     fribidi
     gawk
     bash
@@ -35,9 +35,9 @@ stdenv.mkDerivation {
   meta = {
     inherit (s) version;
     description = ''translate using google api'';
-    license = stdenv.lib.licenses.free;
-    maintainers = [stdenv.lib.maintainers.makefu];
-    platforms = stdenv.lib.platforms.linux ;
+    license = lib.licenses.free;
+    maintainers = [ lib.maintainers.makefu ];
+    platforms = lib.platforms.linux ;
   };
 }
 

From 5c613bd73a1d91ee3d08d62950bf86822f4fece6 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:34:43 +0200
Subject: [PATCH 28/30] whatsupnix: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/simple/whatsupnix/default.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/krebs/5pkgs/simple/whatsupnix/default.nix b/krebs/5pkgs/simple/whatsupnix/default.nix
index 62ef597c8..61972bb05 100644
--- a/krebs/5pkgs/simple/whatsupnix/default.nix
+++ b/krebs/5pkgs/simple/whatsupnix/default.nix
@@ -1,4 +1,6 @@
-{ bash, coreutils, gawk, makeWrapper, nix, openssh, stdenv }:
+{ lib, makeWrapper, stdenv
+, bash, coreutils, gawk, nix, openssh
+}:
 
 stdenv.mkDerivation {
   name = "whatsupnix";
@@ -8,7 +10,7 @@ stdenv.mkDerivation {
     mkdir -p $out/bin
     cat - ${./whatsupnix.bash} > $out/bin/whatsupnix <<\EOF
     #! ${bash}/bin/bash
-    export PATH=${stdenv.lib.makeBinPath [ coreutils gawk nix openssh ]}
+    export PATH=${lib.makeBinPath [ coreutils gawk nix openssh ]}
     EOF
     chmod +x $out/bin/whatsupnix
   '';

From 12dbb95b1b6d74addc0d9d70e599a56af60c3bea Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:35:56 +0200
Subject: [PATCH 29/30] infest-cac-centos7: stdenv.lib -> lib

Deprecated since nixpkgs 21.05
---
 krebs/5pkgs/test/infest-cac-centos7/default.nix | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/krebs/5pkgs/test/infest-cac-centos7/default.nix b/krebs/5pkgs/test/infest-cac-centos7/default.nix
index 9b14bf486..c3fc0ee2b 100644
--- a/krebs/5pkgs/test/infest-cac-centos7/default.nix
+++ b/krebs/5pkgs/test/infest-cac-centos7/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, coreutils, makeWrapper,
-  cac-api, cac-cert, cac-panel, gnumake, gnused, jq, openssh, sshpass, proot,
-  ... }:
+{ lib, makeWrapper, stdenv
+, cac-api, cac-cert, cac-panel, coreutils, gnumake, gnused, jq, openssh, proot, sshpass
+}:
 
 stdenv.mkDerivation rec {
   name = "${shortname}-${version}";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ makeWrapper ];
 
-  path = stdenv.lib.makeSearchPath "bin" [
+  path = lib.makeSearchPath "bin" [
     coreutils
     cac-api
     cac-panel
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
         --set REQUESTS_CA_BUNDLE ${cac-cert} \
         --set SSL_CERT_FILE ${cac-cert}
   '';
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = http://krebsco.de;
     description = "infest a CaC box with stockholm";
     license = licenses.wtfpl;

From c4c40afca5cd83917376804ae6e8259cbfc571d9 Mon Sep 17 00:00:00 2001
From: tv <tv@krebsco.de>
Date: Wed, 2 Jun 2021 01:06:58 +0200
Subject: [PATCH 30/30] flameshot: add imgur patch for 0.9.0

For nixpkgs 21.05
---
 krebs/5pkgs/override/default.nix              | 46 ++++---------------
 .../flameshot/flameshot_imgur_0.6.0.patch     | 34 ++++++++++++++
 .../flameshot/flameshot_imgur_0.9.0.patch     | 35 ++++++++++++++
 3 files changed, 77 insertions(+), 38 deletions(-)
 create mode 100644 krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch
 create mode 100644 krebs/5pkgs/override/flameshot/flameshot_imgur_0.9.0.patch

diff --git a/krebs/5pkgs/override/default.nix b/krebs/5pkgs/override/default.nix
index 926e9dccd..4cb6a1cb4 100644
--- a/krebs/5pkgs/override/default.nix
+++ b/krebs/5pkgs/override/default.nix
@@ -11,44 +11,14 @@ self: super: {
   });
 
   flameshot = super.flameshot.overrideAttrs (old: rec {
-    patches = old.patches or [] ++ [
-      (self.writeText "flameshot-imgur.patch" /* diff */ ''
---- a/src/tools/imgur/imguruploader.cpp
-+++ b/src/tools/imgur/imguruploader.cpp
-@@ -40,6 +40,7 @@
- #include <QTimer>
- #include <QJsonDocument>
- #include <QJsonObject>
-+#include <stdlib.h>
- 
- ImgurUploader::ImgurUploader(const QPixmap &capture, QWidget *parent) :
-     QWidget(parent), m_pixmap(capture)
-@@ -74,7 +75,10 @@ void ImgurUploader::handleReply(QNetworkReply *reply) {
-         QJsonObject json = response.object();
-         QJsonObject data = json["data"].toObject();
-         m_imageURL.setUrl(data["link"].toString());
--        m_deleteImageURL.setUrl(QString("https://imgur.com/delete/%1").arg(
-+        char *deleteImageURLPattern = secure_getenv("IMGUR_DELETE_URL");
-+        if (deleteImageURLPattern == NULL)
-+            deleteImageURLPattern = "https://imgur.com/delete/%1";
-+        m_deleteImageURL.setUrl(QString(deleteImageURLPattern).arg(
-                                     data["deletehash"].toString()));
-         onUploadOk();
-     } else {
-@@ -105,7 +109,10 @@ void ImgurUploader::upload() {
-     QString description = FileNameHandler().parsedPattern();
-     urlQuery.addQueryItem("description", description);
- 
--    QUrl url("https://api.imgur.com/3/image");
-+    char *createImageURLPattern = secure_getenv("IMGUR_CREATE_URL");
-+    if (createImageURLPattern == NULL)
-+        createImageURLPattern = "https://api.imgur.com/3/image";
-+    QUrl url(createImageURLPattern);
-     url.setQuery(urlQuery);
-     QNetworkRequest request(url);
-     request.setHeader(QNetworkRequest::ContentTypeHeader,
-      '')
-    ];
+    patches = old.patches or [] ++ {
+      "0.6.0" = [
+        ./flameshot/flameshot_imgur_0.6.0.patch
+      ];
+      "0.9.0" = [
+        ./flameshot/flameshot_imgur_0.9.0.patch
+      ];
+    }.${old.version};
   });
 
   # https://github.com/proot-me/PRoot/issues/106
diff --git a/krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch b/krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch
new file mode 100644
index 000000000..92023554a
--- /dev/null
+++ b/krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch
@@ -0,0 +1,34 @@
+--- a/src/tools/imgur/imguruploader.cpp
++++ b/src/tools/imgur/imguruploader.cpp
+@@ -40,6 +40,7 @@
+ #include <QTimer>
+ #include <QJsonDocument>
+ #include <QJsonObject>
++#include <stdlib.h>
+ 
+ ImgurUploader::ImgurUploader(const QPixmap &capture, QWidget *parent) :
+     QWidget(parent), m_pixmap(capture)
+@@ -74,7 +75,10 @@ void ImgurUploader::handleReply(QNetworkReply *reply) {
+         QJsonObject json = response.object();
+         QJsonObject data = json["data"].toObject();
+         m_imageURL.setUrl(data["link"].toString());
+-        m_deleteImageURL.setUrl(QString("https://imgur.com/delete/%1").arg(
++        char *deleteImageURLPattern = secure_getenv("IMGUR_DELETE_URL");
++        if (deleteImageURLPattern == NULL)
++            deleteImageURLPattern = "https://imgur.com/delete/%1";
++        m_deleteImageURL.setUrl(QString(deleteImageURLPattern).arg(
+                                     data["deletehash"].toString()));
+         onUploadOk();
+     } else {
+@@ -105,7 +109,10 @@ void ImgurUploader::upload() {
+     QString description = FileNameHandler().parsedPattern();
+     urlQuery.addQueryItem("description", description);
+ 
+-    QUrl url("https://api.imgur.com/3/image");
++    char *createImageURLPattern = secure_getenv("IMGUR_CREATE_URL");
++    if (createImageURLPattern == NULL)
++        createImageURLPattern = "https://api.imgur.com/3/image";
++    QUrl url(createImageURLPattern);
+     url.setQuery(urlQuery);
+     QNetworkRequest request(url);
+     request.setHeader(QNetworkRequest::ContentTypeHeader,
diff --git a/krebs/5pkgs/override/flameshot/flameshot_imgur_0.9.0.patch b/krebs/5pkgs/override/flameshot/flameshot_imgur_0.9.0.patch
new file mode 100644
index 000000000..c4c0bf38a
--- /dev/null
+++ b/krebs/5pkgs/override/flameshot/flameshot_imgur_0.9.0.patch
@@ -0,0 +1,35 @@
+--- a/src/tools/imgur/imguruploader.cpp
++++ b/src/tools/imgur/imguruploader.cpp
+@@ -31,6 +31,7 @@
+ #include <QTimer>
+ #include <QUrlQuery>
+ #include <QVBoxLayout>
++#include <stdlib.h>
+ 
+ ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent)
+   : QWidget(parent)
+@@ -79,8 +80,11 @@ void ImgurUploader::handleReply(QNetworkReply* reply)
+         m_imageURL.setUrl(data[QStringLiteral("link")].toString());
+ 
+         auto deleteToken = data[QStringLiteral("deletehash")].toString();
++        char *deleteImageURLPattern = secure_getenv("IMGUR_DELETE_URL");
++        if (deleteImageURLPattern == NULL)
++            deleteImageURLPattern = "https://imgur.com/delete/%1";
+         m_deleteImageURL.setUrl(
+-          QStringLiteral("https://imgur.com/delete/%1").arg(deleteToken));
++          QString::fromUtf8(deleteImageURLPattern).arg(deleteToken));
+ 
+         // save history
+         QString imageName = m_imageURL.toString();
+@@ -133,7 +137,10 @@ void ImgurUploader::upload()
+     QString description = FileNameHandler().parsedPattern();
+     urlQuery.addQueryItem(QStringLiteral("description"), description);
+ 
+-    QUrl url(QStringLiteral("https://api.imgur.com/3/image"));
++    char *createImageURLPattern = secure_getenv("IMGUR_CREATE_URL");
++    if (createImageURLPattern == NULL)
++        createImageURLPattern = "https://api.imgur.com/3/image";
++    QUrl url(QString::fromUtf8(createImageURLPattern));
+     url.setQuery(urlQuery);
+     QNetworkRequest request(url);
+     request.setHeader(QNetworkRequest::ContentTypeHeader,