chore(ops/nixos): drop ops.rebuild-system
This doesn't really work in all cases anyways, and currently isn't used to deploy - remove it. Change-Id: I6684d9583cb036d851ab6cd9f4c811973a7882fc Reviewed-on: https://cl.snix.dev/c/snix/+/30242 Autosubmit: Florian Klink <flokli@flokli.de> Tested-by: besadii Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
This commit is contained in:
parent
2bedbfdb18
commit
8e1fa6435c
2 changed files with 0 additions and 20 deletions
|
|
@ -38,25 +38,6 @@ in rec {
|
||||||
(throw "${hostname} is not a known NixOS host")
|
(throw "${hostname} is not a known NixOS host")
|
||||||
(map nixosFor depot.ops.machines.all-systems));
|
(map nixosFor depot.ops.machines.all-systems));
|
||||||
|
|
||||||
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
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
|
||||||
echo "Oh no! Only root is allowed to rebuild the system!" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Rebuilding NixOS for $HOSTNAME"
|
|
||||||
system=$(${pkgs.nix}/bin/nix-build -E "((import ${depotPath} {}).ops.nixos.findSystem \"$HOSTNAME\").system" --no-out-link --show-trace)
|
|
||||||
|
|
||||||
${pkgs.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set $system
|
|
||||||
$system/bin/switch-to-configuration switch
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Systems that should be built in CI
|
# Systems that should be built in CI
|
||||||
archivistEC2System = nixosFor depot.ops.machines.archivist-ec2;
|
archivistEC2System = nixosFor depot.ops.machines.archivist-ec2;
|
||||||
gerrit01System = nixosFor depot.ops.machines.gerrit01;
|
gerrit01System = nixosFor depot.ops.machines.gerrit01;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ depot.nix.lazy-deps {
|
||||||
nint.attr = "nix.nint";
|
nint.attr = "nix.nint";
|
||||||
niv.attr = "third_party.nixpkgs.niv";
|
niv.attr = "third_party.nixpkgs.niv";
|
||||||
nixpkgs-fmt.attr = "third_party.nixpkgs.nixpkgs-fmt";
|
nixpkgs-fmt.attr = "third_party.nixpkgs.nixpkgs-fmt";
|
||||||
rebuild-system.attr = "ops.nixos.rebuild-system";
|
|
||||||
rink.attr = "third_party.nixpkgs.rink";
|
rink.attr = "third_party.nixpkgs.rink";
|
||||||
|
|
||||||
tf-buildkite = {
|
tf-buildkite = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue