From a73714a93c2d5e1ce2f9e52f23eaf3019a5d46ed Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 3 Jul 2020 00:26:33 -0400 Subject: feat(ops/nixos): Add generic rebuild-system script This adds a first crack at one idea for a generic, non-user-specific rebuild-system script to ops.nixos.rebuild-system. The idea here is that we enumerate all the nixos systems stored in the monorepo (similarly to what we do for ci-builds right now) then search through them by hostname to find the one matching the hostname of the current system, which is an attempt at a more generic version of tazjin's rebuilder script which does the same thing but with an explicit case block. As a caveat, it feels like there's a slight possibility that this way of finding systems is going to get slow to evaluate - on my system it feels fine but if it grows out of hand it's probably feasible to just bake this into the built script as a dynamically generated case statement. Change-Id: I2e4c5401913b6f4d936ab48ba2f95f96e0e78eb4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/894 Tested-by: BuildkiteCI Reviewed-by: lukegb --- bin/__dispatch.sh | 3 +++ bin/rebuild-system | 1 + 2 files changed, 4 insertions(+) create mode 120000 bin/rebuild-system (limited to 'bin') diff --git a/bin/__dispatch.sh b/bin/__dispatch.sh index e8d54fec39c9..fa954ae29c1d 100755 --- a/bin/__dispatch.sh +++ b/bin/__dispatch.sh @@ -52,6 +52,9 @@ case "${TARGET_TOOL}" in hash-password) attr="tools.hash-password" ;; + rebuild-system) + attr="ops.nixos.rebuild-system" + ;; *) echo "The tool '${TARGET_TOOL}' is currently not installed in this repository." exit 1 diff --git a/bin/rebuild-system b/bin/rebuild-system new file mode 120000 index 000000000000..8390ec9c9652 --- /dev/null +++ b/bin/rebuild-system @@ -0,0 +1 @@ +__dispatch.sh \ No newline at end of file -- cgit 1.4.1