Skip to content

Instantly share code, notes, and snippets.

@r-k-b
Last active May 19, 2022 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r-k-b/8afa0ab5a544fdf0e3a197d87f43f9c5 to your computer and use it in GitHub Desktop.
Save r-k-b/8afa0ab5a544fdf0e3a197d87f43f9c5 to your computer and use it in GitHub Desktop.
NixOS flakes and private repos in Azure DevOps / VSTS / visualstudio.com

Examples of working Flake urls to private AzOps repos:

nix run 'git+https://pacifichealthdynamics.visualstudio.com/PHDSys/_git/PHDSys-net?ref=integration&rev=43fb2415eac77af745ef481de769327d95c69fe5#hippoApiRT'
nix run 'git+ssh://pacifichealthdynamics@vs-ssh.visualstudio.com/v3/pacifichealthdynamics/PHDSys/PHDSys-net?ref=integration&rev=43fb2415eac77af745ef481de769327d95c69fe5#hippoApiRT'

🛈 The rev parameter and the output name (#hippoApiRT) aren't mandatory, they're shown here for reference.

malformed SSH urls from MS Azure

Note that the ssh urls you get from the Clone → SSH button in AzOps use : after the hostname, which Nix doesn't like. Replace the user@vs-ssh.visualstudio.com:v3/orgname part with user@vs-ssh.visualstudio.com/v3/orgname for use in flake input urls.

example errors from malformed SSH urls

fetching Git repository 'ssh://pacifichealthdynamics@vs-ssh.visualstudio.com/pacifichealthdynamics/PHDSys/PHDSys-net'remote: Command git-upload-pack '/pacifichealthdynamics/PHDSys/PHDSys-net' is not in expected format.
fatal: Could not read from remote repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment