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 = {
|
deploy = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = toString (pkgs.writeScript "deploy" ''
|
program = toString (pkgs.writeScript "self-deploy" ''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
domain='dadada.li'
|
|
||||||
flake=$(nix flake metadata --json ${./.} | jq -r .url)
|
flake=$(nix flake metadata --json ${./.} | jq -r .url)
|
||||||
for host in "$@"
|
deploy ''${flake}
|
||||||
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
|
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,9 @@ let
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nodes.ifrit = daNode "ifrit";
|
nodes = builtins.mapAttrs (hostname: fun: fun hostname) {
|
||||||
nodes.pruflas = daNode "pruflas";
|
ifrit = daNode;
|
||||||
|
pruflas = daNode;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue