shell.nix: Use pinned nixpkgs from flake.lock

This commit is contained in:
adisbladis 2022-05-26 18:22:53 +08:00
parent c9d91f60a7
commit d83a46b61f

View file

@ -1,9 +1,21 @@
{ pkgs ? import <nixpkgs> {
overlays = [
(import ./overlay.nix)
];
}
{ pkgs ? (
let
inherit (builtins) fromJSON readFile;
flakeLock = fromJSON (readFile ./flake.lock);
locked = flakeLock.nodes.nixpkgs.locked;
nixpkgs = assert locked.type == "github"; builtins.fetchTarball {
url = "https://github.com/${locked.owner}/${locked.repo}/archive/${locked.rev}.tar.gz";
sha256 = locked.narHash;
};
in
import nixpkgs {
overlays = [
(import ./overlay.nix)
];
}
)
}:
let
pythonEnv = pkgs.python3.withPackages (_: [ ]);