mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
ci: Add default.nix with exposed pkgs
Allows reusing it in more places
(cherry picked from commit 1700d00588
)
This commit is contained in:
parent
b112355dd3
commit
4bedbf85a9
27
ci/default.nix
Normal file
27
ci/default.nix
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
let
|
||||||
|
pinnedNixpkgs = builtins.fromJSON (builtins.readFile ./pinned-nixpkgs.json);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
system ? builtins.currentSystem,
|
||||||
|
|
||||||
|
nixpkgs ? null,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
nixpkgs' =
|
||||||
|
if nixpkgs == null then
|
||||||
|
fetchTarball {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/${pinnedNixpkgs.rev}.tar.gz";
|
||||||
|
sha256 = pinnedNixpkgs.sha256;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
nixpkgs;
|
||||||
|
|
||||||
|
pkgs = import nixpkgs' {
|
||||||
|
inherit system;
|
||||||
|
config = { };
|
||||||
|
overlays = [ ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit pkgs;
|
||||||
|
}
|
15
shell.nix
15
shell.nix
@ -11,23 +11,12 @@
|
|||||||
#
|
#
|
||||||
# nix-shell --arg nixpkgs ./.
|
# nix-shell --arg nixpkgs ./.
|
||||||
#
|
#
|
||||||
let
|
|
||||||
pinnedNixpkgs = builtins.fromJSON (builtins.readFile ci/pinned-nixpkgs.json);
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
system ? builtins.currentSystem,
|
system ? builtins.currentSystem,
|
||||||
|
nixpkgs ? null,
|
||||||
nixpkgs ? fetchTarball {
|
|
||||||
url = "https://github.com/NixOS/nixpkgs/archive/${pinnedNixpkgs.rev}.tar.gz";
|
|
||||||
sha256 = pinnedNixpkgs.sha256;
|
|
||||||
},
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs {
|
inherit (import ./ci { inherit nixpkgs system; }) pkgs;
|
||||||
inherit system;
|
|
||||||
config = {};
|
|
||||||
overlays = [];
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
pkgs.mkShellNoCC {
|
pkgs.mkShellNoCC {
|
||||||
packages = [
|
packages = [
|
||||||
|
Loading…
Reference in New Issue
Block a user