Skip to content

Commit

Permalink
Garnix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana committed Jan 14, 2025
1 parent 2a121d7 commit f4494eb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion garnix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ 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:
- 'hydraJobs.*.*'
- 'checks.*.*'
6 changes: 3 additions & 3 deletions nix/outputs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
in [
{
inherit (project) cabalProject;
inherit project;
inherit project repoRoot;

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

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

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

Expand Down Expand Up @@ -82,5 +82,5 @@ in [
hydraJobs.ghc910.roots = ghc910.hydraJobs.roots;
hydraJobs.ghc910.plan-nix = ghc910.hydraJobs.plan-nix;
})
{ __test = inputs.flake-utils.lib.flattenTree inputs.self.hydraJobs.ghc96; }
{ checks = repoRoot.nix.utils.flattenDerivationTree "garnix" "-" inputs.self.hydraJobs.${system}; }
]
18 changes: 18 additions & 0 deletions nix/utils.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ 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);

}

0 comments on commit f4494eb

Please sign in to comment.