ci: pin nixpkgs to locked version instead of <nixpkgs>

This commit is contained in:
xeals 2023-02-23 10:11:47 +11:00
parent b21cbda697
commit f20db9aa1b
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C
2 changed files with 13 additions and 1 deletions

2
ci.nix
View File

@ -9,7 +9,7 @@
# then your CI will be able to build and cache only those packages for # then your CI will be able to build and cache only those packages for
# which this is possible. # which this is possible.
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import ./flake-compat.nix { src = ./.; } }:
with builtins; with builtins;

12
flake-compat.nix Normal file
View File

@ -0,0 +1,12 @@
{ src, system ? builtins.currentSystem or "unknown-system" }:
let
lockFilePath = "${src}/flake.lock";
lockFile = builtins.fromJSON (builtins.readFile lockFilePath);
nixpkgs = lockFile.nodes.nixpkgs.locked;
tarball = fetchTarball {
url = "https://github.com/${nixpkgs.owner}/${nixpkgs.repo}/archive/${nixpkgs.rev}.zip";
sha256 = nixpkgs.narHash;
};
in
import tarball { inherit system; }