Skip to content

Commit 0bd98ac

Browse files
committed
Add a flake layer on top of the current infrastructure.
Use explicit system for purity. Replace dots in bundle names to make the CLI usable.
1 parent f6c3c26 commit 0bd98ac

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

.nix/fallback-config.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ with import "${import ./nixpkgs.nix}/lib";
1414

1515
## select an entry to build in the following `bundles` set
1616
## defaults to "default"
17-
default-bundle = "8.18";
17+
default-bundle = "rocq-9.0";
1818

1919
## write one `bundles.name` attribute set per
2020
## alternative configuration, the can be used to

flake.lock

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

flake.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
description = "The Rocq Nix Toolbox";
3+
inputs = {
4+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
5+
};
6+
7+
outputs =
8+
{ nixpkgs, ... }:
9+
rec {
10+
lib = rec {
11+
forAllSystems =
12+
function:
13+
nixpkgs.lib.genAttrs [
14+
"x86_64-linux"
15+
"aarch64-linux"
16+
"x86_64-darwin"
17+
"aarch64-darwin"
18+
] function;
19+
allPackages =
20+
src:
21+
with nixpkgs.lib;
22+
forAllSystems (
23+
system:
24+
let
25+
underlyingNix = (import ./default.nix { inherit system src; });
26+
instances = underlyingNix.passthru.setup.instances;
27+
defaultInstance =
28+
underlyingNix.passthru.setup.instances.${underlyingNix.passthru.setup.config.default-bundle};
29+
jobsList = mapAttrsToList (
30+
bundleName: instance:
31+
let
32+
listOfJobs = map (jobName: {
33+
name = "${builtins.replaceStrings [ "." ] [ "-" ] bundleName}:${jobName}";
34+
value = instance.pkgs.rocqPackages.${jobName} or instance.pkgs.coqPackages.${jobName};
35+
}) instance.jobs;
36+
in
37+
listToAttrs listOfJobs
38+
) instances;
39+
in
40+
(foldl mergeAttrs { } jobsList)
41+
// {
42+
default = defaultInstance.this-pkg;
43+
}
44+
);
45+
};
46+
packages = lib.allPackages ./.;
47+
};
48+
}

0 commit comments

Comments
 (0)