NixOS / nixops

NixOps is a tool for deploying to NixOS machines in a network or cloud.
https://nixos.org/nixops
GNU Lesser General Public License v3.0
1.87k stars 364 forks source link

Cannot use with fetchTarball after recent flakes migration due to builtins.fetchGit #1370

Closed cole-h closed 4 years ago

cole-h commented 4 years ago

The following shell.nix does not work:

let
  pkgs = import <nixpkgs> {};
  nixops = import (fetchTarball "https://github.com/NixOS/nixops/archive/master.tar.gz");
in
pkgs.mkShell {
  buildInputs = [ nixops ];
}

This is because of https://github.com/NixOS/nixops/blob/5a36c7b77c96ea0f843aed9a2e1e0ea451635886/default.nix#L5 -- there is no .git served with the master tarball, so no git commands will work.

Output of nix-shell --show-trace shell.nix:

fatal: '/nix/store/016174sf6gbrw96szs3f1nf6cgiz49xv-source' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: while evaluating the attribute 'buildInputs' of the derivation 'nix-shell' at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/build-support/mkshell/default.nix:28:3:
while evaluating 'getOutput' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:464:23, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/stdenv/generic/make-derivation.nix:143:17, called from undefined position:
while evaluating the file '/nix/store/016174sf6gbrw96szs3f1nf6cgiz49xv-source/default.nix':
while evaluating the attribute 'defaultNix' at /nix/store/y91vx4bq08c04r1chnc97jidhxnzhsjz-source/default.nix:114:5:
program 'git' failed with exit code 128