diff --git a/lib/morph.nix b/lib/morph.nix index 975bada..3a8679c 100644 --- a/lib/morph.nix +++ b/lib/morph.nix @@ -1,5 +1,4 @@ -{ nixpkgs -, nixosConfigurations +{ self , extraMorphModules ? [ ] }: @@ -7,6 +6,9 @@ # (builtins.getFlake (toString ./.)).morph-entrypoint builtins.currentSystem let + inherit (self.inputs) nixpkgs; + inherit (self) nixosConfigurations; + helpers = system: let pkgs = nixpkgs.legacyPackages.${system}; @@ -96,6 +98,12 @@ in 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 ''; + 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 '' ip="$(nix eval --raw ".#nixosConfigurations.\"$1\".config.sconfig.morph.deployment.targetHost")" shift