From 0b88386484d3cd989cb8d56b790c07646673fdb6 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 15 May 2024 13:46:27 +0300 Subject: [PATCH] Add PATH search note and OpenSSH section --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 78eaa23..2dd6d71 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,12 @@ shell like so, in a NixOS module: # exits with an error, fish will be launched instead. And if fish fails, the # fallback shell, which is pkgs.bashInteractive will get run. environment.sessionVariables.SHELLS = "${lib.getExe pkgs.nushell}:${lib.getExe pkgs.fish}"; + + # This would also work, as Crash searches $PATH: + # + # environment.sessionVariables.SHELLS = "nu:fish"; + # + # However, just setting an absolute path is pretty easy and better. }) # Uncomment to make the fallback shell of crash pkgs.dash. Will require a recompilation! @@ -62,6 +68,30 @@ shell like so, in a NixOS module: } ``` +## Tips & Tricks + +You can control the default shell / program that will get launched +by SSH using Crash. All you need to do it make OpenSSH accept the `SHELLS` +environment variable and set it when SSH'ing in. Here is a NixOS +module that does that: + +```nix +{ + services.openssh = { + enable = true; + settings.AcceptEnv = "SHELLS"; + }; +} +``` + +And you can utilize it by doing: + +```shell +$ SHELLS="fish:nu:bash:dash" ssh user@host +``` + +This will launch you into fish, if that fails, into nu and so on... + ## Credits - [noshell](https://github.com/viperML/noshell): This was the primary source of