Use nixpkgs from flake.lock and support attrs when importing bscpkgs #2

Closed
abonerib wants to merge 1 commits from abonerib:feat/import-bscpkgs into master
2 changed files with 15 additions and 16 deletions
Showing only changes of commit 2aa9eff970 - Show all commits

View File

@ -1,11 +1,19 @@
let
bscOverlay = import ./overlay.nix;
# Pin the nixpkgs
nixpkgsPath = import ./nixpkgs.nix;
pkgs = import nixpkgsPath {
overlays = [ bscOverlay ];
# read flake.lock and determine revision from there
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
inherit (lock.nodes.nixpkgs.locked) rev narHash;
fetchedNixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
sha256 = narHash;
};
in pkgs
in
{ overlays ? [ ]
, nixpkgs ? fetchedNixpkgs
, ...
}@attrs:
import nixpkgs (
(builtins.removeAttrs attrs [ "overlays" "nixpkgs" ]) //
{ overlays = [ bscOverlay ] ++ overlays; }
)

View File

@ -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=";
}