about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-05-08 10:55:28 +0000
committerAlyssa Ross <hi@alyssa.is>2023-05-08 10:55:28 +0000
commit0b0da29cd3b5ccec16ff33557c2dc4468a7f7496 (patch)
treed4c022c9d22dbb712a2278aba83eddfbbadac19e
parent62bcf6c8024b99fa7063ee84c03b286cb19a2578 (diff)
downloadinfra-0b0da29cd3b5ccec16ff33557c2dc4468a7f7496.tar
infra-0b0da29cd3b5ccec16ff33557c2dc4468a7f7496.tar.gz
infra-0b0da29cd3b5ccec16ff33557c2dc4468a7f7496.tar.bz2
infra-0b0da29cd3b5ccec16ff33557c2dc4468a7f7496.tar.lz
infra-0b0da29cd3b5ccec16ff33557c2dc4468a7f7496.tar.xz
infra-0b0da29cd3b5ccec16ff33557c2dc4468a7f7496.tar.zst
infra-0b0da29cd3b5ccec16ff33557c2dc4468a7f7496.zip
run: GC after rebuilding
There will probably be some store paths no longer in use, so we might
as well do a GC run to maximise the memory available for builds.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
-rw-r--r--run2
1 files changed, 2 insertions, 0 deletions
diff --git a/run b/run
index 2c24025..fa19bda 100644
--- a/run
+++ b/run
@@ -87,6 +87,8 @@ nixos-rebuild switch -I nixos-config=/etc/nixos/configuration.nix \
 	-I nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos
 systemctl start --no-block multi-user.target systemd-journal-gatewayd.socket
 
+systemd-run -u nix-collect-garbage nix-collect-garbage -d
+
 exec systemd-run --wait -u nix-build \
 	-p Restart=on-failure \
 	-p StartLimitBurst=5 \