fix(ops/nixos): Don't use the store path for depot

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
This commit is contained in:
Aspen Smith 2024-02-20 13:14:51 -05:00 committed by clbot
parent 5ced8e7292
commit f50800a9df

View file

@ -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