about summary refs log tree commit diff
path: root/overrides
diff options
context:
space:
mode:
Diffstat (limited to 'overrides')
-rw-r--r--overrides/default.nix13
-rw-r--r--overrides/elmPackages/default.nix10
-rw-r--r--overrides/kontemplate/default.nix13
-rw-r--r--overrides/writeElispBin/default.nix23
4 files changed, 59 insertions, 0 deletions
diff --git a/overrides/default.nix b/overrides/default.nix
new file mode 100644
index 000000000000..8bc49dec475a
--- /dev/null
+++ b/overrides/default.nix
@@ -0,0 +1,13 @@
+# This file is used to move things from nested attribute sets to the
+# top-level.
+{ depot, ... }:
+
+{
+  buildGo = depot.nix.buildGo; # TODO(tazjin): remove this
+
+  # 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 (depot.third_party) go ripgrep;
+}
diff --git a/overrides/elmPackages/default.nix b/overrides/elmPackages/default.nix
new file mode 100644
index 000000000000..3df44420a6bb
--- /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.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..6147d1f465ee
--- /dev/null
+++ b/overrides/kontemplate/default.nix
@@ -0,0 +1,13 @@
+{ depot, ... }:
+
+with depot;
+
+third_party.writeShellScriptBin "kontemplate" ''
+  export PATH="${ops.kms_pass}/bin:$PATH"
+
+  if [[ -z $1 ]]; then
+    exec ${ops.kontemplate}/bin/kontemplate
+  fi
+
+  exec ${ops.kontemplate}/bin/kontemplate $1 ${./../..}/ops/infra/kubernetes/primary-cluster.yaml ''${@:2}
+''
diff --git a/overrides/writeElispBin/default.nix b/overrides/writeElispBin/default.nix
new file mode 100644
index 000000000000..8fd61f39487d
--- /dev/null
+++ b/overrides/writeElispBin/default.nix
@@ -0,0 +1,23 @@
+{ pkgs, ... }:
+
+{ name, src, deps ? (_: []), emacs ? pkgs.emacs26-nox }:
+
+let
+  inherit (pkgs) 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} $@
+  '';
+}