Skip to content

Commit

Permalink
[devbox] Download nixpkgs using fetchTarball (#2639)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
loreto authored Aug 26, 2022
1 parent e4e9b3b commit 9f0decc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions tmpl/default.nix.tmpl
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions tmpl/shell.nix.tmpl
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 9f0decc

Please sign in to comment.