summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/5pkgs')
-rw-r--r--krebs/5pkgs/haskell/default.nix10
-rw-r--r--krebs/5pkgs/haskell/mailaids.nix10
-rw-r--r--krebs/5pkgs/haskell/nix-serve-ng.nix30
-rw-r--r--krebs/5pkgs/haskell/purebred-email/default.nix16
-rw-r--r--krebs/5pkgs/simple/certaids.nix109
5 files changed, 156 insertions, 19 deletions
diff --git a/krebs/5pkgs/haskell/default.nix b/krebs/5pkgs/haskell/default.nix
index 98cbcb3b9..7e9ee7521 100644
--- a/krebs/5pkgs/haskell/default.nix
+++ b/krebs/5pkgs/haskell/default.nix
@@ -8,11 +8,13 @@ in
haskell = super.haskell // {
packages = mapAttrs (name: value:
if hasAttr "override" value
- then value.override { inherit overrides; }
+ then value.override (old: {
+ overrides = composeExtensions (old.overrides or (_: _: {})) overrides;
+ })
else value
) super.haskell.packages;
};
- haskellPackages = super.haskellPackages.override {
- inherit overrides;
- };
+ haskellPackages = super.haskellPackages.override (old: {
+ overrides = composeExtensions (old.overrides or (_: _: {})) overrides;
+ });
}
diff --git a/krebs/5pkgs/haskell/mailaids.nix b/krebs/5pkgs/haskell/mailaids.nix
index f152a76f4..91b4cc451 100644
--- a/krebs/5pkgs/haskell/mailaids.nix
+++ b/krebs/5pkgs/haskell/mailaids.nix
@@ -1,14 +1,14 @@
{ mkDerivation, aeson, aeson-pretty, base, bytestring
-, case-insensitive, fetchgit, lens, optparse-applicative
-, purebred-email, lib, text, vector, word8
+, case-insensitive, fetchgit, lens, lib, optparse-applicative
+, purebred-email, text, vector, word8
}:
mkDerivation {
pname = "mailaids";
- version = "1.0.0";
+ version = "1.1.0";
src = fetchgit {
url = "https://cgit.krebsco.de/mailaids";
- sha256 = "15h0k82czm89gkwhp1rwdy77jz8dmb626qdz7c2narvz9j7169v5";
- rev = "8f11927ea74d6adb332c884502ebd9c486837523";
+ sha256 = "0mkq3b0j28h7ydg6aaqlqnvajb8nhdc9g7rmil2d4vl5fxxaqspv";
+ rev = "a25fc32eceefc10a91ef77ff2763b3f1b9324aaf";
fetchSubmodules = true;
};
isLibrary = false;
diff --git a/krebs/5pkgs/haskell/nix-serve-ng.nix b/krebs/5pkgs/haskell/nix-serve-ng.nix
new file mode 100644
index 000000000..8866b205b
--- /dev/null
+++ b/krebs/5pkgs/haskell/nix-serve-ng.nix
@@ -0,0 +1,30 @@
+{ mkDerivation, async, base, base16, base32, bytestring, charset
+, fetchgit, http-client, http-types, lib, managed, megaparsec, mtl
+, network, nix, optparse-applicative, tasty-bench, temporary, text
+, turtle, vector, wai, wai-extra, warp, warp-tls
+, boost
+}:
+mkDerivation {
+ pname = "nix-serve-ng";
+ version = "1.0.0";
+ src = fetchgit {
+ url = "https://github.com/aristanetworks/nix-serve-ng";
+ sha256 = "0mqp67z5mi8rsjahdh395n7ppf0b65k8rd3pvnl281g02rbr69y2";
+ rev = "433f70f4daae156b84853f5aaa11987aa5ce7277";
+ fetchSubmodules = true;
+ };
+ isLibrary = false;
+ isExecutable = true;
+ executableHaskellDepends = [
+ base base16 base32 bytestring charset http-types managed megaparsec
+ mtl network optparse-applicative vector wai wai-extra warp warp-tls
+ ];
+ executablePkgconfigDepends = [ nix ];
+ executableSystemDepends = [ boost.dev ];
+ benchmarkHaskellDepends = [
+ async base bytestring http-client tasty-bench temporary text turtle
+ vector
+ ];
+ description = "A drop-in replacement for nix-serve that's faster and more stable";
+ license = lib.licenses.bsd3;
+}
diff --git a/krebs/5pkgs/haskell/purebred-email/default.nix b/krebs/5pkgs/haskell/purebred-email/default.nix
index ebf315388..62fc82183 100644
--- a/krebs/5pkgs/haskell/purebred-email/default.nix
+++ b/krebs/5pkgs/haskell/purebred-email/default.nix
@@ -1,31 +1,27 @@
{ mkDerivation, attoparsec, base, base64-bytestring, bytestring
, case-insensitive, concise, deepseq, fetchgit, hedgehog, lens, lib
-, QuickCheck, quickcheck-instances, semigroupoids, semigroups
+, QuickCheck, quickcheck-instances, random, semigroupoids
, stringsearch, tasty, tasty-golden, tasty-hedgehog, tasty-hunit
, tasty-quickcheck, text, time
}:
mkDerivation {
pname = "purebred-email";
- version = "0.4.3";
+ version = "0.5.1";
src = fetchgit {
url = "https://github.com/purebred-mua/purebred-email";
- sha256 = "06xhccavrdzfsvg65mzdnp0a7b1ilk2rqpnyvkr171ir6mqdpb19";
- rev = "769b360643f699c0a8cd6f1c3a3de36cf0479834";
+ sha256 = "0iilyy5dkbzbiazyyfjdz585c3x8b7c2piynmycm7krkc48993vw";
+ rev = "7ba346e10ad1521a923bc04a4ffeca479d8dd071";
fetchSubmodules = true;
};
- patches = [
- ./untweak-mime-version-header.patch
- ];
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
attoparsec base base64-bytestring bytestring case-insensitive
- concise deepseq lens semigroupoids semigroups stringsearch text
- time
+ concise deepseq lens random semigroupoids stringsearch text time
];
testHaskellDepends = [
attoparsec base bytestring case-insensitive hedgehog lens
- QuickCheck quickcheck-instances semigroups tasty tasty-golden
+ QuickCheck quickcheck-instances random tasty tasty-golden
tasty-hedgehog tasty-hunit tasty-quickcheck text time
];
homepage = "https://github.com/purebred-mua/purebred-email";
diff --git a/krebs/5pkgs/simple/certaids.nix b/krebs/5pkgs/simple/certaids.nix
new file mode 100644
index 000000000..34f4c3e14
--- /dev/null
+++ b/krebs/5pkgs/simple/certaids.nix
@@ -0,0 +1,109 @@
+{ pkgs }:
+
+pkgs.write "certaids" {
+ "/bin/cert2json".link = pkgs.writeDash "cert2json" ''
+ # usage: cert2json < CERT > JSON
+ set -efu
+
+ ${pkgs.openssl}/bin/openssl crl2pkcs7 -nocrl -certfile /dev/stdin |
+ ${pkgs.openssl}/bin/openssl pkcs7 -print_certs -text |
+ ${pkgs.gawk}/bin/awk -F, -f ${pkgs.writeText "cert2json.awk" ''
+ function abort(msg) {
+ print(msg) > "/dev/stderr"
+ exit 1
+ }
+
+ function toJSON(x, type, ret) {
+ type = typeof(x)
+ switch (type) {
+ case "array":
+ if (isArray(x)) return arrayToJSON(x)
+ if (isObject(x)) return objectToJSON(x)
+ abort("cannot render array to JSON", x)
+ case "number":
+ return numberToJSON(x)
+ case "string":
+ return stringToJSON(x)
+ case "strnum":
+ case "unassigned":
+ case "regexp":
+ case "untyped":
+ default:
+ abort("cannot render type: " type)
+ }
+ }
+
+ function isArray(x, i, k) {
+ i = 1
+ for (k in x) {
+ if (k != i++) return 0
+ i++
+ }
+ return 1
+ }
+
+ function isObject(x, k) {
+ for (k in x) {
+ if (typeof(k) != "string") return 0
+ }
+ return 1
+ }
+
+ function arrayToJSON(x, k, ret) {
+ ret = "["
+ for (k in x) {
+ ret=ret toJSON(x[k]) ","
+ }
+ sub(/,$/,"",ret)
+ ret=ret "]"
+ return ret
+ }
+
+ function objectToJSON(x, k,ret) {
+ ret = "{"
+ for (k in x) {
+ ret = ret toJSON(k) ":" toJSON(x[k]) ","
+ }
+ sub(/,$/, "", ret)
+ ret = ret "}"
+ return ret
+ }
+
+ function numberToJSON(x) {
+ return x
+ }
+
+ function stringToJSON(x) {
+ gsub(/\\/, "&&",x)
+ gsub(/\n/, "\\n", x)
+ return "\"" x "\""
+ }
+
+ $1 ~ /^ *(Subject|Issuer):/ {
+ sub(/^ */, "")
+ sub(/: */, ",")
+ key=tolower($1)
+ sub(/[^,]*,/, "")
+
+ # Normalize separators between relative distinguished names.
+ # [1]: RFC2253, 3. Parsing a String back to a Distinguished Name
+ # TODO support any distinguished name
+ gsub(/ *[;,] */, ",")
+
+ for(i = 0; i <= NF; i++) {
+ split($i, a, "=")
+ cache[key][a[1]] = a[2]
+ }
+ }
+
+ /BEGIN CERTIFICATE/,/END CERTIFICATE/{
+ cache["certificate"] = cache["certificate"] $0 "\n"
+ }
+
+ /END CERTIFICATE/{
+ print toJSON(cache)
+ delete cache
+ }
+ ''}
+ '';
+}