about summary refs log tree commit diff
path: root/ops
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-02-20T18·14-0500
committerclbot <clbot@tvl.fyi>2024-02-21T06·11+0000
commitf50800a9dffb18572ca28b8afd592b8a7c203607 (patch)
tree3186435a9ea344453c7f9080045a1b6b0d3fcb1d /ops
parent5ced8e7292384fc93dd8dad652c2612be4ba5d4a (diff)
fix(ops/nixos): Don't use the store path for depot r/7581
Using an actual store path here means we have to copy all of depot into
the Nix store just to rebuild NixOS for a system - this is especially
painful if, like me, you have a rust target/ directory in depot which is
hundreds of GB - nix-build just OOMed on my system with 128GB of RAM!

There's no reason to use a store path here - we can just point to
wherever depot happened to be cloned.

Change-Id: Ibfd7181f0f75de077561db70ac8636389836980f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10997
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: aspen <root@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'ops')
-rw-r--r--ops/nixos.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/ops/nixos.nix b/ops/nixos.nix
index 147a016efc00..1442d89b30c1 100644
--- a/ops/nixos.nix
+++ b/ops/nixos.nix
@@ -40,7 +40,10 @@ in rec {
       (throw "${hostname} is not a known NixOS host")
       (map nixosFor depot.ops.machines.all-systems));
 
-  rebuild-system = rebuildSystemWith depot.path;
+  rebuild-system = rebuildSystemWith (
+    # HACK: use the string of the original source to avoid copying the whole
+    # depot into the store just for this
+    builtins.toString depot.path.origSrc);
 
   rebuildSystemWith = depotPath: pkgs.writeShellScriptBin "rebuild-system" ''
     set -ue