summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/5pkgs/simple')
-rw-r--r--krebs/5pkgs/simple/buildbot-classic/default.nix34
-rw-r--r--krebs/5pkgs/simple/buildbot-classic/sqlparse.nix34
-rw-r--r--krebs/5pkgs/simple/generate-krebs-intermediate-ca/default.nix30
3 files changed, 30 insertions, 68 deletions
diff --git a/krebs/5pkgs/simple/buildbot-classic/default.nix b/krebs/5pkgs/simple/buildbot-classic/default.nix
deleted file mode 100644
index 5e075f1a1..000000000
--- a/krebs/5pkgs/simple/buildbot-classic/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ pkgs, fetchFromGitHub, python2Packages, git, ... }: let
-
- # we need the old sqlparse since the new one is python2 incompatible
- sqlparse = python2Packages.callPackage ./sqlparse.nix {};
-
-in python2Packages.buildPythonApplication rec {
- name = "buildbot-classic-${version}";
- version = "0.8.18";
- namePrefix = "";
- patches = [];
-
- src = fetchFromGitHub {
- owner = "krebs";
- repo = "buildbot-classic";
- rev = version;
- sha256 = "0b4y3n9zd2gdy8xwk1vpvs4n9fbg72vi8mx4ydgijwngcmdqkjmq";
- };
- postUnpack = "sourceRoot=\${sourceRoot}/master";
-
- propagatedBuildInputs = [
- python2Packages.jinja2
- python2Packages.twisted
- python2Packages.dateutil
- (python2Packages.sqlalchemy_migrate.override { sqlparse = sqlparse; })
- python2Packages.pysqlite
- pkgs.coreutils
- ];
- doCheck = false;
- postInstall = ''
- mkdir -p "$out/share/man/man1"
- cp docs/buildbot.1 "$out/share/man/man1"
- '';
-}
-
diff --git a/krebs/5pkgs/simple/buildbot-classic/sqlparse.nix b/krebs/5pkgs/simple/buildbot-classic/sqlparse.nix
deleted file mode 100644
index 2cbb51845..000000000
--- a/krebs/5pkgs/simple/buildbot-classic/sqlparse.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, pytest
-, isPy3k
-}:
-
-buildPythonPackage rec {
- pname = "sqlparse";
- version = "0.3.1";
-
- src = fetchPypi {
- inherit pname version;
- sha256 = "e162203737712307dfe78860cc56c8da8a852ab2ee33750e33aeadf38d12c548";
- };
-
- checkInputs = [ pytest ];
- checkPhase = ''
- py.test
- '';
-
- # Package supports 3.x, but tests are clearly 2.x only.
- doCheck = !isPy3k;
-
- meta = with lib; {
- description = "Non-validating SQL parser for Python";
- longDescription = ''
- Provides support for parsing, splitting and formatting SQL statements.
- '';
- homepage = "https://github.com/andialbrecht/sqlparse";
- license = licenses.bsd3;
- };
-
-}
diff --git a/krebs/5pkgs/simple/generate-krebs-intermediate-ca/default.nix b/krebs/5pkgs/simple/generate-krebs-intermediate-ca/default.nix
new file mode 100644
index 000000000..5055a78aa
--- /dev/null
+++ b/krebs/5pkgs/simple/generate-krebs-intermediate-ca/default.nix
@@ -0,0 +1,30 @@
+{ pkgs }:
+pkgs.writers.writeDashBin "generate-intermediate-ca" ''
+ TMPDIR=$(mktemp -d)
+ trap "rm -rf $TMPDIR;" INT TERM EXIT
+ mkdir -p "$TMPDIR/krebs"
+ brain show ca/ca.key > "$TMPDIR/krebs/ca.key"
+ brain show ca/ca.crt > "$TMPDIR/krebs/ca.crt"
+ export STEPPATH="$TMPDIR/step"
+ cat << EOF > "$TMPDIR/intermediate.tpl"
+ {
+ "subject": {{ toJson .Subject }},
+ "keyUsage": ["certSign", "crlSign"],
+ "basicConstraints": {
+ "isCA": true,
+ "maxPathLen": 0
+ },
+ "nameConstraints": {
+ "critical": true,
+ "permittedDNSDomains": ["r" ,"w"]
+ }
+ }
+ EOF
+
+ ${pkgs.step-cli}/bin/step certificate create "Krebs ACME CA" intermediate_ca.crt intermediate_ca.key \
+ --template "$TMPDIR/intermediate.tpl" \
+ --not-after 8760h \
+ --ca "$TMPDIR/krebs/ca.crt" \
+ --ca-key "$TMPDIR/krebs/ca.key" \
+ --no-password --insecure
+''