Skip to content

NIX_SSHOPTS is broken for localhost (but not 127.0.0.1) since Nix 2.31.0 #14148

@cole-h

Description

@cole-h

Describe the bug

NIX_SSHOPTS does not work for specifying flags to SSH, such as NIX_SSHOPTS='-p2222 -oUserKnownHostsFile=/dev/null'.

Steps To Reproduce

  1. Try to copy something over SSH using NIX_SSHOPTS (i.e. to a different port than the default 22)

Expected behavior

I was using this for a local VM, so the path already existed in my root@localhost store, but not in my root@localhost:2222 store. I expected NIX_SSHOPTS='-p2222 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no' /home/vin/workspace/vcs/nix/result/bin/nix copy /nix/store/..... --to ssh-ng://root@localhost --no-check-sigs -v to actually copy the closure, but instead it just says:

copying 0 paths...

Metadata

$ nix-env --version
nix-env (Nix) 2.31.2

Additional context

I bisected this to 49ba061 (#14148).

cc @xokdvium @Ericson2314

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions