diff --git a/default.nix b/default.nix index a28f759..14c06c6 100644 --- a/default.nix +++ b/default.nix @@ -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; } +) diff --git a/nixpkgs.nix b/nixpkgs.nix deleted file mode 100644 index 2075697..0000000 --- a/nixpkgs.nix +++ /dev/null @@ -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 ` - sha256 = "sha256-de9KYi8rSJpqvBfNwscWdalIJXPo8NjdIZcEJum1mH0="; -}