From e578b8499f9e49441d9761875659381f95975fee Mon Sep 17 00:00:00 2001 From: adisbladis Date: Thu, 14 Nov 2019 16:06:30 +0000 Subject: [PATCH] fetchgitPrivate: Remove fetcher Since Nix 2.0 we have `builtins.fetchGit` which is a much better option since it runs in the evaluator and has access to the regular users ssh keys. --- pkgs/build-support/fetchgit/private.nix | 26 ------------------------- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 28 deletions(-) delete mode 100644 pkgs/build-support/fetchgit/private.nix diff --git a/pkgs/build-support/fetchgit/private.nix b/pkgs/build-support/fetchgit/private.nix deleted file mode 100644 index 6731cf87fbd1..000000000000 --- a/pkgs/build-support/fetchgit/private.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ fetchgit, runCommand, makeWrapper, openssh }: args: derivation ((fetchgit args).drvAttrs // { - SSH_AUTH_SOCK = if (builtins.tryEval ).success - then builtins.toString - else null; - - GIT_SSH = let - config = let - sshConfigFile = if (builtins.tryEval ).success - then - else builtins.trace '' - Please set your nix-path such that ssh-config-file points to a file that will allow ssh to access private repositories. The builder will not be able to see any running ssh agent sessions unless ssh-auth-sock is also set in the nix-path. - - Note that the config file and any keys it points to must be readable by the build user, which depending on your nix configuration means making it readable by the build-users-group, the user of the running nix-daemon, or the user calling the nix command which started the build. Similarly, if using an ssh agent ssh-auth-sock must point to a socket the build user can access. - - You may need StrictHostKeyChecking=no in the config file. Since ssh will refuse to use a group-readable private key, if using build-users you will likely want to use something like IdentityFile /some/directory/%u/key and have a directory for each build user accessible to that user. - '' "/var/lib/empty/config"; - in builtins.toString sshConfigFile; - - ssh-wrapped = runCommand "fetchgit-ssh" { - nativeBuildInputs = [ makeWrapper ]; - } '' - mkdir -p $out/bin - makeWrapper ${openssh}/bin/ssh $out/bin/ssh --prefix PATH : "$out/bin" --add-flags "-F ${config}" "$@" - ''; - in "${ssh-wrapped}/bin/ssh"; -}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cb53dcdb5c35..97a9a6809389 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -250,8 +250,6 @@ in cacert = buildPackages.cacert; }; - fetchgitPrivate = callPackage ../build-support/fetchgit/private.nix { }; - fetchgitLocal = callPackage ../build-support/fetchgitlocal { }; fetchmtn = callPackage ../build-support/fetchmtn (config.fetchmtn or {});