about summary refs log tree commit diff
path: root/ops
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-12-15T23·09-0500
committergrfn <grfn@gws.fyi>2021-12-16T14·17+0000
commitd85c6a1b56eae850a972d7c0708525a736d33d01 (patch)
treed8ab9097fb9da173928dbf04a840e35b11f1a4d7 /ops
parent01f4212ca184c9be40b84a3f9365c17796d6b6f3 (diff)
feat(ops/modules): Provide some modules to all nixoses r/3266
For modules that are gated behind a mkEnableOption, it's reasonable to
just provide them to all Depot-built nixos systems without requiring
people to explicitly import them. This defines a special module called
`default-imports.nix` which imports these modules (currently just
tvl-cache.nix and automatic-gc.nix, as I'm being rather conservative
adding things here to avoid breaking anyone's system), then provides
that module as one of the `modules` passed at the top-level
nixos/eval-config invocation.

Change-Id: I3be299ab10ae4c451ef11c514edb3c89318a2278
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4345
Tested-by: BuildkiteCI
Autosubmit: grfn <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'ops')
-rw-r--r--ops/machines/whitby/default.nix1
-rw-r--r--ops/modules/default-imports.nix13
2 files changed, 13 insertions, 1 deletions
diff --git a/ops/machines/whitby/default.nix b/ops/machines/whitby/default.nix
index e082f9588919..dbd8c616401c 100644
--- a/ops/machines/whitby/default.nix
+++ b/ops/machines/whitby/default.nix
@@ -7,7 +7,6 @@ let
 in {
   imports = [
     "${depot.path}/ops/modules/atward.nix"
-    "${depot.path}/ops/modules/automatic-gc.nix"
     "${depot.path}/ops/modules/clbot.nix"
     "${depot.path}/ops/modules/gerrit-queue.nix"
     "${depot.path}/ops/modules/git-serving.nix"
diff --git a/ops/modules/default-imports.nix b/ops/modules/default-imports.nix
new file mode 100644
index 000000000000..acd70bd05f01
--- /dev/null
+++ b/ops/modules/default-imports.nix
@@ -0,0 +1,13 @@
+{ depot, ... }:
+
+# Default set of modules that are imported in all Depot nixos systems
+#
+# All modules here should be properly gated behind a `lib.mkEnableOption` with a
+# `lib.mkIf` for the config.
+
+{
+  imports = [
+    ./automatic-gc.nix
+    ./tvl-cache.nix
+  ];
+}