Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support colmena eval --raw #184

Open
srid opened this issue Dec 2, 2023 · 0 comments
Open

Support colmena eval --raw #184

srid opened this issue Dec 2, 2023 · 0 comments

Comments

@srid
Copy link

srid commented Dec 2, 2023

❯ colmena eval -E '{ nodes, ... }: let cfg = nodes.fpindia-chat.config.deployment; in "${cfg.targetUser}@${cfg.targetHost}"'
[INFO ] Using flake: git+file:///Users/srid/code/fpindia-chat
"admin@165.22.214.173"

A --raw that removes those wrapping quotes in the output would be nice.

This would allow me to remove the tr -d '"' in the following script (used, incidentally, to ssh to the remote node):

pkgs.writeShellScriptBin "ssh-to-remote"
  ''
    ADDR=''$(${lib.getExe pkgs.colmena} eval -E '{ nodes, ... }:
        let cfg = nodes.myserver.config.deployment;
        in "''${cfg.targetUser}@''${cfg.targetHost}"' | tr -d '"'
    )
    set -x
    ssh $ADDR
  '';

Real-world usage: fpindia/fpindia-chat@1e3fc47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant