about summary refs log tree commit diff
path: root/overrides
diff options
context:
space:
mode:
Diffstat (limited to 'overrides')
-rw-r--r--overrides/default.nix28
-rw-r--r--overrides/elmPackages/default.nix10
-rw-r--r--overrides/kontemplate/default.nix19
-rw-r--r--overrides/lispPackages/default.nix8
-rw-r--r--overrides/lispPackages/quicklisp-to-nix-output/cl-prevalence.nix27
-rw-r--r--overrides/lispPackages/quicklisp-to-nix-output/s-sysdeps.nix25
-rw-r--r--overrides/lispPackages/quicklisp-to-nix-output/s-xml.nix27
-rw-r--r--overrides/lispPackages/quicklisp.nix26
-rw-r--r--overrides/writeElispBin/default.nix23
9 files changed, 193 insertions, 0 deletions
diff --git a/overrides/default.nix b/overrides/default.nix
new file mode 100644
index 000000000000..2159d45bd0b6
--- /dev/null
+++ b/overrides/default.nix
@@ -0,0 +1,28 @@
+# This file is used to move things from nested attribute sets to the
+# top-level.
+{ pkgs, ... }:
+
+{
+  buildGo = pkgs.nix.buildGo;
+
+  # These packages must be exposed at the top-level for compatibility
+  # with Nixery.
+  inherit (pkgs.third_party)
+    bashInteractive
+    cacert
+    coreutils
+    iana-etc
+    jq
+    moreutils
+    nano
+    openssl
+    runCommand
+    symlinkJoin
+    writeText;
+
+  # These packages must be exposed for compatibility with buildGo.
+  #
+  # Despite buildGo being tracked in this tree, I want it to be possible
+  # for external users to import it with the default nixpkgs layout.
+  inherit (pkgs.third_party) go ripgrep;
+}
diff --git a/overrides/elmPackages/default.nix b/overrides/elmPackages/default.nix
new file mode 100644
index 000000000000..20026d9180ea
--- /dev/null
+++ b/overrides/elmPackages/default.nix
@@ -0,0 +1,10 @@
+# Gemma needs an older version of Elm to be built. Updating it to
+# the newer version is a lot of effort.
+{ pkgs, ... }:
+
+(import (pkgs.third_party.fetchFromGitHub {
+  owner = "NixOS";
+  repo = "nixpkgs";
+  rev = "14f9ee66e63077539252f8b4550049381a082518";
+  sha256 = "1wn7nmb1cqfk2j91l3rwc6yhimfkzxprb8wknw5wi57yhq9m6lv1";
+}) {}).elmPackages
diff --git a/overrides/kontemplate/default.nix b/overrides/kontemplate/default.nix
new file mode 100644
index 000000000000..74693c38377f
--- /dev/null
+++ b/overrides/kontemplate/default.nix
@@ -0,0 +1,19 @@
+{ pkgs, ... }:
+
+let master = pkgs.third_party.kontemplate.overrideAttrs(_: {
+  src = pkgs.third_party.fetchFromGitHub {
+    owner = "tazjin";
+    repo = "kontemplate";
+    rev = "v1.8.0";
+    sha256 = "123mjmmm4hynraq1fpn3j5i0a1i87l265kkjraxxxbl0zacv74i1";
+  };
+});
+in pkgs.third_party.writeShellScriptBin "kontemplate" ''
+  export PATH="${pkgs.ops.kms_pass}/bin:$PATH"
+
+  if [[ -z $1 ]]; then
+    exec ${master}/bin/kontemplate
+  fi
+
+  exec ${master}/bin/kontemplate $1 ${./../..}/ops/infra/kubernetes/primary-cluster.yaml ''${@:2}
+''
diff --git a/overrides/lispPackages/default.nix b/overrides/lispPackages/default.nix
new file mode 100644
index 000000000000..c6502975e310
--- /dev/null
+++ b/overrides/lispPackages/default.nix
@@ -0,0 +1,8 @@
+# One of Gemma's dependencies is missing in nixpkgs' Quicklisp
+# package set, it is overlaid locally here.
+{ pkgs, ... }:
+
+import ./quicklisp.nix {
+  inherit (pkgs) lib;
+  inherit (pkgs.third_party) lispPackages;
+}
diff --git a/overrides/lispPackages/quicklisp-to-nix-output/cl-prevalence.nix b/overrides/lispPackages/quicklisp-to-nix-output/cl-prevalence.nix
new file mode 100644
index 000000000000..4e5e3ec5d6e8
--- /dev/null
+++ b/overrides/lispPackages/quicklisp-to-nix-output/cl-prevalence.nix
@@ -0,0 +1,27 @@
+args @ { fetchurl, ... }:
+rec {
+  baseName = ''cl-prevalence'';
+  version = ''20130720-hg'';
+
+  description = ''Common Lisp Prevalence Package'';
+
+  deps = [ args."s-sysdeps" args."s-xml" ];
+
+  src = fetchurl {
+    url = ''http://beta.quicklisp.org/archive/cl-prevalence/2013-07-20/cl-prevalence-20130720-hg.tgz'';
+    sha256 = ''09pqbw6xcgy0242npiqw7sd8jwwjc0kz7m0sas48jjr0zgnnmi89'';
+  };
+
+  packageName = "cl-prevalence";
+
+  asdFilesToKeep = ["cl-prevalence.asd"];
+  overrides = x: x;
+}
+/* (SYSTEM cl-prevalence DESCRIPTION Common Lisp Prevalence Package SHA256
+    09pqbw6xcgy0242npiqw7sd8jwwjc0kz7m0sas48jjr0zgnnmi89 URL
+    http://beta.quicklisp.org/archive/cl-prevalence/2013-07-20/cl-prevalence-20130720-hg.tgz
+    MD5 6176c34b8e1621b65906b1575d9fa20d NAME cl-prevalence FILENAME
+    cl-prevalence DEPS
+    ((NAME s-sysdeps FILENAME s-sysdeps) (NAME s-xml FILENAME s-xml))
+    DEPENDENCIES (s-sysdeps s-xml) VERSION 20130720-hg SIBLINGS
+    (cl-prevalence-test) PARASITES NIL) */
diff --git a/overrides/lispPackages/quicklisp-to-nix-output/s-sysdeps.nix b/overrides/lispPackages/quicklisp-to-nix-output/s-sysdeps.nix
new file mode 100644
index 000000000000..1c28ec6e2afd
--- /dev/null
+++ b/overrides/lispPackages/quicklisp-to-nix-output/s-sysdeps.nix
@@ -0,0 +1,25 @@
+args @ { fetchurl, ... }:
+rec {
+  baseName = ''s-sysdeps'';
+  version = ''20130128-git'';
+
+  description = ''An abstraction layer over platform dependent functionality'';
+
+  deps = [ ];
+
+  src = fetchurl {
+    url = ''http://beta.quicklisp.org/archive/s-sysdeps/2013-01-28/s-sysdeps-20130128-git.tgz'';
+    sha256 = ''048q0mzypnm284bvv7036d4z7bv7rdcqks5l372s74kq279l2y00'';
+  };
+
+  packageName = "s-sysdeps";
+
+  asdFilesToKeep = ["s-sysdeps.asd"];
+  overrides = x: x;
+}
+/* (SYSTEM s-sysdeps DESCRIPTION
+    An abstraction layer over platform dependent functionality SHA256
+    048q0mzypnm284bvv7036d4z7bv7rdcqks5l372s74kq279l2y00 URL
+    http://beta.quicklisp.org/archive/s-sysdeps/2013-01-28/s-sysdeps-20130128-git.tgz
+    MD5 2fe61fadafd62ef9597e17b4783889ef NAME s-sysdeps FILENAME s-sysdeps DEPS
+    NIL DEPENDENCIES NIL VERSION 20130128-git SIBLINGS NIL PARASITES NIL) */
diff --git a/overrides/lispPackages/quicklisp-to-nix-output/s-xml.nix b/overrides/lispPackages/quicklisp-to-nix-output/s-xml.nix
new file mode 100644
index 000000000000..ec12dde52231
--- /dev/null
+++ b/overrides/lispPackages/quicklisp-to-nix-output/s-xml.nix
@@ -0,0 +1,27 @@
+args @ { fetchurl, ... }:
+rec {
+  baseName = ''s-xml'';
+  version = ''20150608-git'';
+
+  parasites = [ "s-xml.examples" "s-xml.test" ];
+
+  description = ''Simple Common Lisp XML Parser'';
+
+  deps = [ ];
+
+  src = fetchurl {
+    url = ''http://beta.quicklisp.org/archive/s-xml/2015-06-08/s-xml-20150608-git.tgz'';
+    sha256 = ''0cy36wqzasqma4maw9djq1vdwsp5hxq8svlbnhbv9sq9zzys5viq'';
+  };
+
+  packageName = "s-xml";
+
+  asdFilesToKeep = ["s-xml.asd"];
+  overrides = x: x;
+}
+/* (SYSTEM s-xml DESCRIPTION Simple Common Lisp XML Parser SHA256
+    0cy36wqzasqma4maw9djq1vdwsp5hxq8svlbnhbv9sq9zzys5viq URL
+    http://beta.quicklisp.org/archive/s-xml/2015-06-08/s-xml-20150608-git.tgz
+    MD5 9c31c80f0661777c493fab683f776716 NAME s-xml FILENAME s-xml DEPS NIL
+    DEPENDENCIES NIL VERSION 20150608-git SIBLINGS NIL PARASITES
+    (s-xml.examples s-xml.test)) */
diff --git a/overrides/lispPackages/quicklisp.nix b/overrides/lispPackages/quicklisp.nix
new file mode 100644
index 000000000000..1d23db762d34
--- /dev/null
+++ b/overrides/lispPackages/quicklisp.nix
@@ -0,0 +1,26 @@
+{ lib, lispPackages }:
+
+let inherit (lispPackages) buildLispPackage qlOverrides fetchurl;
+in lispPackages // lib.fix(self: {
+  "s-xml" = buildLispPackage
+    ((f: x: (x // (f x)))
+       (qlOverrides."s-xml" or (x: {}))
+       (import ./quicklisp-to-nix-output/s-xml.nix {
+         inherit fetchurl;
+       }));
+
+  "s-sysdeps" = buildLispPackage
+    ((f: x: (x // (f x)))
+       (qlOverrides."s-sysdeps" or (x: {}))
+       (import ./quicklisp-to-nix-output/s-sysdeps.nix {
+         inherit fetchurl;
+       }));
+
+  "cl-prevalence" = buildLispPackage
+    ((f: x: (x // (f x)))
+       (qlOverrides."cl-prevalence" or (x: {}))
+       (import ./quicklisp-to-nix-output/cl-prevalence.nix {
+         inherit fetchurl;
+         inherit (self) s-sysdeps s-xml;
+       }));
+})
diff --git a/overrides/writeElispBin/default.nix b/overrides/writeElispBin/default.nix
new file mode 100644
index 000000000000..a1616fb9d464
--- /dev/null
+++ b/overrides/writeElispBin/default.nix
@@ -0,0 +1,23 @@
+{ pkgs, ... }:
+
+{ name, src, deps ? (_: []), emacs ? pkgs.third_party.emacs26-nox }:
+
+let
+  inherit (pkgs.third_party) emacsPackagesNg emacsPackagesNgGen writeTextFile;
+  inherit (builtins) isString toFile;
+
+  finalEmacs = (emacsPackagesNgGen emacs).emacsWithPackages deps;
+
+  srcFile = if isString src
+    then toFile "${name}.el" src
+    else src;
+in writeTextFile {
+  inherit name;
+  executable = true;
+  destination = "/bin/${name}";
+
+  text = ''
+    #!/bin/sh
+    ${finalEmacs}/bin/emacs --batch --no-site-file --script ${srcFile} $@
+  '';
+}