remove old deploy script

This commit is contained in:
Tim Schubert 2022-08-23 23:51:17 +02:00
parent d1f4753462
commit 5bdcf5c658
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
2 changed files with 6 additions and 26 deletions

View file

@ -11,32 +11,10 @@
deploy = {
type = "app";
program = toString (pkgs.writeScript "deploy" ''
program = toString (pkgs.writeScript "self-deploy" ''
#!${pkgs.runtimeShell}
domain='dadada.li'
flake=$(nix flake metadata --json ${./.} | jq -r .url)
for host in "$@"
do
echo "=== Deploying ''${host} ==="
nixos-rebuild switch --upgrade --flake "''${flake}#$host" --target-host "''${host}.$domain" --build-host localhost --use-remote-sudo
done
'');
};
hm-switch = {
type = "app";
program = toString (pkgs.writeScript "hm-switch" ''
#!${pkgs.runtimeShell}
set -eu -o pipefail -x
tmpdir=$(mktemp -d)
export PATH=${pkgs.lib.makeBinPath [pkgs.coreutils pkgs.nixFlakes pkgs.jq]}
trap "rm -rf $tmpdir" EXIT
declare -A profiles=(["gorgon"]="home")
profile=''${profiles[$HOSTNAME]:-common}
flake=$(nix flake metadata --json ${./.} | jq -r .url)
nix build --out-link "$tmpdir/result" "$flake#hmConfigurations.''${profile}.activationPackage" "$@"
link=$(realpath $tmpdir/result)
$link/activate
deploy ''${flake}
'');
};
}

View file

@ -17,7 +17,9 @@ let
};
in
{
nodes.ifrit = daNode "ifrit";
nodes.pruflas = daNode "pruflas";
nodes = builtins.mapAttrs (hostname: fun: fun hostname) {
ifrit = daNode;
pruflas = daNode;
};
}