From 9f0decc0efe2bef4a702e2dccbc6f4a39c80d44c Mon Sep 17 00:00:00 2001 From: Daniel Loreto <279789+loreto@users.noreply.github.com> Date: Fri, 26 Aug 2022 10:38:15 -0700 Subject: [PATCH] [devbox] Download nixpkgs using fetchTarball (#2639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Download nixpkgs using `fetchTarball`. We were previously using `fetchGit`, but it's too slow – users have been complaining that the first call to `devbox shell` takes to long, and part of it is due to `fetchGit`. Replacing with `fetchTarball` instead. ## How was it tested? Re-built and ran on example projects. ## Is this change backwards-compatible? Yes, I kept the same version of nixpkgs and everything. --- tmpl/default.nix.tmpl | 7 +++---- tmpl/shell.nix.tmpl | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tmpl/default.nix.tmpl b/tmpl/default.nix.tmpl index 573a894af6d..3b642926d1b 100644 --- a/tmpl/default.nix.tmpl +++ b/tmpl/default.nix.tmpl @@ -1,10 +1,9 @@ let - pkgs = import (fetchGit { - url = "https://github.com/nixos/nixpkgs/"; - ref = "refs/heads/nixos-unstable"; + pkgs = import (fetchTarball { # Commit hash as of 2022-08-16 # `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable` - rev = "af9e00071d0971eb292fd5abef334e66eda3cb69"; + url = "https://github.com/nixos/nixpkgs/archive/af9e00071d0971eb292fd5abef334e66eda3cb69.tar.gz"; + sha256 = "1mdwy0419m5i9ss6s5frbhgzgyccbwycxm5nal40c8486bai0hwy"; }) {}; in with pkgs; buildEnv { diff --git a/tmpl/shell.nix.tmpl b/tmpl/shell.nix.tmpl index 043c9c779fe..6933a055be2 100644 --- a/tmpl/shell.nix.tmpl +++ b/tmpl/shell.nix.tmpl @@ -1,10 +1,9 @@ let - pkgs = import (fetchGit { - url = "https://github.com/nixos/nixpkgs/"; - ref = "refs/heads/nixos-unstable"; + pkgs = import (fetchTarball { # Commit hash as of 2022-08-16 # `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable` - rev = "af9e00071d0971eb292fd5abef334e66eda3cb69"; + url = "https://github.com/nixos/nixpkgs/archive/af9e00071d0971eb292fd5abef334e66eda3cb69.tar.gz"; + sha256 = "1mdwy0419m5i9ss6s5frbhgzgyccbwycxm5nal40c8486bai0hwy"; }) {}; in with pkgs; mkShell {