File tree 4 files changed +34
-2
lines changed
4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 1
- { pkgs ? import < nixpkgs> { } } :
1
+ { pkgs ? import ( import ./fetch- nixpkgs.nix ) { } } :
2
2
3
3
with pkgs . haskell . lib ;
4
4
Original file line number Diff line number Diff line change
1
+ let
2
+ spec = builtins . fromJSON ( builtins . readFile ./nixpkgs-src.json ) ;
3
+ src = import <nix/fetchurl.nix> {
4
+ url = "https://github.com/${ spec . owner } /${ spec . repo } /archive/${ spec . rev } .tar.gz" ;
5
+ inherit ( spec ) sha256 ;
6
+ } ;
7
+ nixcfg = import <nix/config.nix> ;
8
+ in builtins . derivation {
9
+ system = builtins . currentSystem ;
10
+ name = "${ src . name } -unpacked" ;
11
+ builder = builtins . storePath nixcfg . shell ;
12
+ inherit src ;
13
+ args = [
14
+ ( builtins . toFile "builder" ''
15
+ $coreutils/mkdir $out
16
+ cd $out
17
+ $gzip -d < $src | $tar -x --strip-components=1
18
+ '' )
19
+ ] ;
20
+ coreutils = builtins . storePath nixcfg . coreutils ;
21
+ tar = builtins . storePath nixcfg . tar ;
22
+ gzip = builtins . storePath nixcfg . gzip ;
23
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "owner" : " NixOS" ,
3
+ "repo" : " nixpkgs" ,
4
+ "rev" : " 61fbdb47a69f78998f55207e64122a0798047b5d" ,
5
+ "sha256" : " 050r55sgpy121j5qs00jw43rg5pnqidbdbvvj4lr1i9lmv9f1vfv"
6
+ }
Original file line number Diff line number Diff line change 2
2
#! nix-shell -p cabal2nix stack nix-prefetch-git git cabal-install ghc -i bash
3
3
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/a905b7cd0c2dc0714195a50bf176cd8e4593502d.tar.gz
4
4
5
- export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/a905b7cd0c2dc0714195a50bf176cd8e4593502d.tar.gz
5
+ readlink=$( nix-instantiate --eval -E " /. + (import <nix/config.nix>).coreutils" ) /readlink
6
+ scriptDir=$( dirname -- " $( $readlink -f -- " ${BASH_SOURCE[0]} " ) " )
7
+ export NIX_PATH=" nixpkgs=$( nix-build " ${scriptDir} /../fetch-nixpkgs.nix" --no-out-link) "
8
+
6
9
7
10
set -ex
8
11
You can’t perform that action at this time.
0 commit comments