Skip to content

Commit cc0f3d6

Browse files
committed
WIP: build nixpkgs revdeps
1 parent cacaad3 commit cc0f3d6

3 files changed

Lines changed: 143 additions & 11 deletions

File tree

.github/workflows/nixpkgs.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: nixpkgs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
merge_group:
10+
11+
jobs:
12+
nixpkgs:
13+
name: Nixpkgs
14+
# TODO: if: contains(github.event.pull_request.labels.*.name, 'test_nixpkgs')
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: cachix/install-nix-action@v22
19+
- run: nix build .#buildNixpkgs.ncb
20+
- run: ./result/bin/nix-ci-build --flake .#packages.x86_64-linux.buildNixpkgs.pkgs.build_4_14

flake.lock

Lines changed: 87 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@
1313
inputs.nixpkgs.follows = "nixpkgs";
1414
inputs.flake-utils.follows = "flake-utils";
1515
};
16+
nix-ci-build = {
17+
url = "github:nix-ocaml/nix-ci-build";
18+
# TODO can't follow
19+
#inputs.nixpkgs.follows = "nixpkgs";
20+
inputs.flake-utils.follows = "flake-utils";
21+
};
1622
};
1723
outputs =
1824
{ self
1925
, flake-utils
2026
, nixpkgs
2127
, ocamllsp
2228
, melange
29+
, nix-ci-build
2330
}:
2431
flake-utils.lib.eachDefaultSystem (system:
2532
let
@@ -79,6 +86,35 @@
7986
installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
8087
};
8188
dune = default;
89+
90+
buildNixpkgs =
91+
let
92+
overlay = (self: super: {
93+
ocaml-ng =
94+
super.ocaml-ng // {
95+
ocamlPackages_4_14 = super.ocaml-ng.ocamlPackages_4_14.overrideScope (pself: psuper: {
96+
dune_3 = packages.default;
97+
});
98+
};
99+
});
100+
nixpkgs-sources =
101+
builtins.fetchTarball
102+
# XXX change url
103+
{url = https://github.com/nix-ocaml/nix-overlays/archive/809dfb173fca728e2834f284208e03b3d53c2581.tar.gz;
104+
sha256= "sha256:1s5pxcwmsfhrr3fsh8n9nf8ahbcs25zi48hw6a0fhh4fyb6l8ggr";}
105+
;
106+
pkgs' =
107+
(import nixpkgs-sources {
108+
inherit system;
109+
config.allowUnfree = true;
110+
}).extend overlay;
111+
nix-ci-build-pkg = nix-ci-build.outputs.packages."${system}".default;
112+
hydra = (import "${nixpkgs-sources}/ci/hydra.nix") {inherit system; pkgs = pkgs';};
113+
in
114+
{
115+
ncb = nix-ci-build-pkg;
116+
pkgs = hydra;
117+
};
82118
};
83119

84120
devShells =

0 commit comments

Comments
 (0)