mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
morph: move jump command
This commit is contained in:
parent
6df30e3223
commit
9de962a802
1 changed files with 10 additions and 7 deletions
|
@ -42,8 +42,16 @@ let
|
||||||
${scriptBody}
|
${scriptBody}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
jump = pkgs.writeShellScript "jump" ''
|
||||||
|
set -eu
|
||||||
|
echo ${self}
|
||||||
|
ip="$(nix eval --raw ".#nixosConfigurations.\"$1\".config.sconfig.morph.deployment.targetHost")"
|
||||||
|
NIX_SSHOPTS="-F${sshConfig}" nix copy --to ssh://root@$ip ${self}
|
||||||
|
exec ssh -oForwardAgent=yes -F"${sshConfig}" "root@$ip" -t "cd ${self}; nix develop"
|
||||||
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
{ inherit pkgs sh sshConfig; };
|
{ inherit jump pkgs sh sshConfig; };
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -53,6 +61,7 @@ in
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export SSH_CONFIG_FILE=${sshConfig}
|
export SSH_CONFIG_FILE=${sshConfig}
|
||||||
alias ssh='ssh -F${sshConfig}'
|
alias ssh='ssh -F${sshConfig}'
|
||||||
|
alias jump=${jump}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -105,11 +114,5 @@ in
|
||||||
ssh root@$ip NIXOS_INSTALL_BOOTLOADER=1 nixos-enter \
|
ssh root@$ip NIXOS_INSTALL_BOOTLOADER=1 nixos-enter \
|
||||||
--root /mnt -- /run/current-system/bin/switch-to-configuration boot
|
--root /mnt -- /run/current-system/bin/switch-to-configuration boot
|
||||||
'';
|
'';
|
||||||
jump = sh ''
|
|
||||||
echo ${self}
|
|
||||||
ip="$(nix eval --raw ".#nixosConfigurations.\"$1\".config.sconfig.morph.deployment.targetHost")"
|
|
||||||
NIX_SSHOPTS="-F${sshConfig}" nix copy --to ssh://root@$ip ${self}
|
|
||||||
exec ssh -oForwardAgent=yes -F"${sshConfig}" "$ip" -t "cd ${self}; nix develop"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue