Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add garnix.yaml #6776

Closed
wants to merge 18 commits into from
48 changes: 41 additions & 7 deletions flake.lock

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

10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
url = "github:input-output-hk/haskell.nix";
inputs.hackage.follows = "hackage";
};

flake-utils.url = "github:numtide/flake-utils";
};

outputs = inputs:
Expand All @@ -39,9 +41,11 @@
};

nixConfig = {
extra-substituters = [ "https://cache.iog.io" ];
extra-trusted-public-keys =
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
extra-substituters = [ "https://cache.iog.io" "https://cache.garnix.io" ];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
allow-import-from-derivation = true;
};
}
5 changes: 5 additions & 0 deletions garnix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
builds:
# TODO once we have fully migrated from hydra to garnix, refactor nix/output.nix
# by removing all references to hydraJobs and populating this `include` section.
include:
- 'checks.*.*'
14 changes: 10 additions & 4 deletions nix/outputs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ let
ghc810 = project.variants.ghc810;
ghc910 = project.variants.ghc910;

in [
in
[
{
inherit (project) cabalProject;
inherit project repoRoot;

devShells.default = ghc96.devShell;
devShells.profiled = ghc96-profiled.devShell;
Expand All @@ -24,7 +26,7 @@ in [

packages = ghc96.packages;
apps = ghc96.apps;
checks = ghc96.checks;
# checks = ghc96.checks;

latex-documents = repoRoot.nix.latex-documents;

Expand All @@ -37,7 +39,7 @@ in [
}

(lib.optionalAttrs (system == "x86_64-linux" || system == "x86_64-darwin") {
hydraJobs.plutus-metatheory-site = repoRoot.nix.plutus-metatheory-site;
packages.plutus-metatheory-site = repoRoot.nix.plutus-metatheory-site;

hydraJobs.ghc96 = ghc96.hydraJobs;
hydraJobs.ghc810 = ghc810.hydraJobs;
Expand All @@ -63,7 +65,7 @@ in [

(lib.optionalAttrs (system == "aarch64-darwin") {
# Plausibly if things build on x86 darwin then they'll build on aarch darwin.
# Se we only build roots and dev sshells on aarch to avoid overloading the builders.
# Se we only build roots and dev shells on aarch to avoid overloading the builders.
hydraJobs.ghc810.devShell = ghc810.devShell;
hydraJobs.ghc96.devShell = ghc96.devShell;
hydraJobs.ghc98.devShell = ghc98.devShell;
Expand All @@ -81,4 +83,8 @@ in [
hydraJobs.ghc910.roots = ghc910.hydraJobs.roots;
hydraJobs.ghc910.plan-nix = ghc910.hydraJobs.plan-nix;
})
{
checks = repoRoot.nix.utils.flattenDerivationTree "ci" "-"
inputs.self.hydraJobs.${system};
}
]
15 changes: 15 additions & 0 deletions nix/utils.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ repoRoot, inputs, pkgs, system, lib }: {

flattenDerivationTree = prefix: separator: set:
let
recurse = name: name':
flatten (if name == "" then name' else "${name}${separator}${name'}");

flatten = name: value:
if lib.isDerivation value || lib.typeOf value != "set" then [{
inherit name value;
}] else
lib.concatLists (lib.mapAttrsToList (recurse name) value);

in assert lib.typeOf set == "set"; lib.listToAttrs (flatten prefix set);
}
Loading