mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
add jump script
This commit is contained in:
parent
32abe188a8
commit
4943514a08
1 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
||||||
{ nixpkgs
|
{ self
|
||||||
, nixosConfigurations
|
|
||||||
, extraMorphModules ? [ ]
|
, extraMorphModules ? [ ]
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -7,6 +6,9 @@
|
||||||
# (builtins.getFlake (toString ./.)).morph-entrypoint builtins.currentSystem
|
# (builtins.getFlake (toString ./.)).morph-entrypoint builtins.currentSystem
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (self.inputs) nixpkgs;
|
||||||
|
inherit (self) nixosConfigurations;
|
||||||
|
|
||||||
helpers = system:
|
helpers = system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
@ -96,6 +98,12 @@ in
|
||||||
ssh root@$ip ln -sfn /proc/mounts /mnt/etc/mtab
|
ssh root@$ip ln -sfn /proc/mounts /mnt/etc/mtab
|
||||||
ssh root@$ip NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root /mnt -- /run/current-system/bin/switch-to-configuration boot
|
ssh root@$ip NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --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"
|
||||||
|
'';
|
||||||
ssh = sh ''
|
ssh = sh ''
|
||||||
ip="$(nix eval --raw ".#nixosConfigurations.\"$1\".config.sconfig.morph.deployment.targetHost")"
|
ip="$(nix eval --raw ".#nixosConfigurations.\"$1\".config.sconfig.morph.deployment.targetHost")"
|
||||||
shift
|
shift
|
||||||
|
|
Loading…
Reference in a new issue