Expand environmental variables in sshOpts
For now only bracket style expansion is enabled, i.e. ${MY_VAR}. I had issues with expanding $MY_VAR in a path string, and so excluded that usecase to avoid errors. One can specify brackets in a Nix string by escaping the $, e.g. "\${NOT_EXPANDED_BY_NIX}".
This doesn't work in '' stype strings and requires a bit more magic:
''${"\${NOT_EXPANDED_BY_NIX}"}''
https://github.com/serokell/deploy-rs/pull/116#issuecomment-896640019
This doesn't work in '' stype strings and requires a bit more magic: ''${"${NOT_EXPANDED_BY_NIX}"}''
Actually, just
nix-repl> ''''${NOT_EXPANDED_BY_NIX}''
"${NOT_EXPANDED_BY_NIX}"
@notgne2, it may just be the library I used, but I have a shell that detects the flake root directory using git rev-parse --show-toplevel when trying to set just "$FLAKE_ROOT/path/to/key" it expanded to an empty string somehow :shrug:
There is probably a similar crate, or maybe I could look at the source, and just reimplement a more minimal version or something.
@balsoft, thanks for the tip!
Maybe this function or part of it can also be hammered into shape to be useful for parsing the cli string into a Vector via the parse(try_from_str = parse_key_val) attribute.
That's the last piece missing (on my todo list) for homogenization of data structures.
Can we merge?
Can you merge?