Skip to content

Commit

Permalink
WIP: build nixpkgs revdeps
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed May 3, 2024
1 parent cacaad3 commit cc0f3d6
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 11 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/nixpkgs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: nixpkgs

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
merge_group:

jobs:
nixpkgs:
name: Nixpkgs
# TODO: if: contains(github.event.pull_request.labels.*.name, 'test_nixpkgs')

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
- run: nix build .#buildNixpkgs.ncb
- run: ./result/bin/nix-ci-build --flake .#packages.x86_64-linux.buildNixpkgs.pkgs.build_4_14
98 changes: 87 additions & 11 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
nix-ci-build = {
url = "github:nix-ocaml/nix-ci-build";
# TODO can't follow
#inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs =
{ self
, flake-utils
, nixpkgs
, ocamllsp
, melange
, nix-ci-build
}:
flake-utils.lib.eachDefaultSystem (system:
let
Expand Down Expand Up @@ -79,6 +86,35 @@
installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
};
dune = default;

buildNixpkgs =
let
overlay = (self: super: {
ocaml-ng =
super.ocaml-ng // {
ocamlPackages_4_14 = super.ocaml-ng.ocamlPackages_4_14.overrideScope (pself: psuper: {
dune_3 = packages.default;
});
};
});
nixpkgs-sources =
builtins.fetchTarball
# XXX change url
{url = https://github.com/nix-ocaml/nix-overlays/archive/809dfb173fca728e2834f284208e03b3d53c2581.tar.gz;
sha256= "sha256:1s5pxcwmsfhrr3fsh8n9nf8ahbcs25zi48hw6a0fhh4fyb6l8ggr";}
;
pkgs' =
(import nixpkgs-sources {
inherit system;
config.allowUnfree = true;
}).extend overlay;
nix-ci-build-pkg = nix-ci-build.outputs.packages."${system}".default;
hydra = (import "${nixpkgs-sources}/ci/hydra.nix") {inherit system; pkgs = pkgs';};
in
{
ncb = nix-ci-build-pkg;
pkgs = hydra;
};
};

devShells =
Expand Down

0 comments on commit cc0f3d6

Please sign in to comment.