Use nixpkgs from flake.lock and support attrs when importing bscpkgs #2
							
								
								
									
										22
									
								
								default.nix
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								default.nix
									
									
									
									
									
								
							| @ -1,11 +1,19 @@ | |||||||
| let | let | ||||||
|   bscOverlay = import ./overlay.nix; |   bscOverlay = import ./overlay.nix; | ||||||
| 
 | 
 | ||||||
|   # Pin the nixpkgs |   # read flake.lock and determine revision from there | ||||||
|   nixpkgsPath = import ./nixpkgs.nix; |   lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||||||
| 
 |   inherit (lock.nodes.nixpkgs.locked) rev narHash; | ||||||
|   pkgs = import nixpkgsPath { |   fetchedNixpkgs = builtins.fetchTarball { | ||||||
|     overlays = [ bscOverlay ]; |     url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; | ||||||
|  |     sha256 = narHash; | ||||||
|   }; |   }; | ||||||
| 
 | in | ||||||
| in pkgs | { overlays ? [ ] | ||||||
|  | , nixpkgs ? fetchedNixpkgs | ||||||
|  | , ... | ||||||
|  | }@attrs: | ||||||
|  | import nixpkgs ( | ||||||
|  |   (builtins.removeAttrs attrs [ "overlays" "nixpkgs" ]) // | ||||||
|  |   { overlays = [ bscOverlay ] ++ overlays; } | ||||||
|  | ) | ||||||
|  | |||||||
| @ -1,9 +0,0 @@ | |||||||
| let |  | ||||||
|   commit = "e4ad989506ec7d71f7302cc3067abd82730a4beb"; |  | ||||||
| in builtins.fetchTarball { |  | ||||||
|     # Descriptive name to make the store path easier to identify |  | ||||||
|     name = "nixpkgs-${commit}"; |  | ||||||
|     url = "https://github.com/nixos/nixpkgs/archive/${commit}.tar.gz"; |  | ||||||
|     # Hash obtained using `nix-prefetch-url --unpack <url>` |  | ||||||
|     sha256 = "sha256-de9KYi8rSJpqvBfNwscWdalIJXPo8NjdIZcEJum1mH0="; |  | ||||||
| } |  | ||||||
		Reference in New Issue
	
	Block a user