Skip to content

Commit 9f0decc

Browse files
authored
[devbox] Download nixpkgs using fetchTarball (#2639)
## 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.
1 parent e4e9b3b commit 9f0decc

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tmpl/default.nix.tmpl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
let
2-
pkgs = import (fetchGit {
3-
url = "https://github.com/nixos/nixpkgs/";
4-
ref = "refs/heads/nixos-unstable";
2+
pkgs = import (fetchTarball {
53
# Commit hash as of 2022-08-16
64
# `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable`
7-
rev = "af9e00071d0971eb292fd5abef334e66eda3cb69";
5+
url = "https://github.com/nixos/nixpkgs/archive/af9e00071d0971eb292fd5abef334e66eda3cb69.tar.gz";
6+
sha256 = "1mdwy0419m5i9ss6s5frbhgzgyccbwycxm5nal40c8486bai0hwy";
87
}) {};
98
in with pkgs;
109
buildEnv {

tmpl/shell.nix.tmpl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
let
2-
pkgs = import (fetchGit {
3-
url = "https://github.com/nixos/nixpkgs/";
4-
ref = "refs/heads/nixos-unstable";
2+
pkgs = import (fetchTarball {
53
# Commit hash as of 2022-08-16
64
# `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable`
7-
rev = "af9e00071d0971eb292fd5abef334e66eda3cb69";
5+
url = "https://github.com/nixos/nixpkgs/archive/af9e00071d0971eb292fd5abef334e66eda3cb69.tar.gz";
6+
sha256 = "1mdwy0419m5i9ss6s5frbhgzgyccbwycxm5nal40c8486bai0hwy";
87
}) {};
98
in with pkgs;
109
mkShell {

0 commit comments

Comments
 (0)