remove old deploy script
This commit is contained in:
parent
d1f4753462
commit
5bdcf5c658
2 changed files with 6 additions and 26 deletions
26
apps.nix
26
apps.nix
|
@ -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}
|
||||
'');
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue