Skip to content

Commit

Permalink
Sync Flaky template
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Oct 23, 2024
1 parent c04c095 commit c56cd27
Show file tree
Hide file tree
Showing 25 changed files with 730 additions and 564 deletions.
17 changes: 7 additions & 10 deletions .cache/vale/Vocab/yaya/accept.txt

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

17 changes: 7 additions & 10 deletions .cache/vale/config/vocabularies/yaya/accept.txt

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

189 changes: 45 additions & 144 deletions .config/project/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,13 @@
self,
supportedSystems,
...
}: let
githubSystems = [
"macos-13" # x86_64-darwin
"macos-14" # aarch64-darwin
"ubuntu-22.04" # x86_64-linux
"windows-2022"
];
in {
}: {
project = {
name = "yaya";
summary = "Yet another … yet another recursion scheme library for Haskell";

devPackages = [
pkgs.cabal-install
pkgs.graphviz
## So cabal-plan(-bounds) can be built in a devShell, since it doesn’t
## work in Nix proper.
pkgs.zlib
];
};

imports = [
(import ./github-ci.nix {
systems = githubSystems;
packages = {
yaya = "core";
yaya-containers = "containers";
yaya-hedgehog = "hedgehog";
yaya-quickcheck = "quickcheck";
yaya-unsafe = "unsafe";
};
exclude = [
## TODO: This particular combination requires libgmp.
{
bounds = "--prefer-oldest";
ghc = "8.6.1";
os = "macos-13";
}
## TODO: This build often hangs for some reason.
{
bounds = "--prefer-oldest";
ghc = "8.8.1";
os = "windows-2022";
}
## TODO: For some reason, this combination fails to build
## ghc-paths-0.1.0.12.
{
ghc = "9.4.1";
os = "macos-14";
}
]
## GitHub can’t install GHC older than 9.4 on macos-14.
++ map (ghc: {
inherit ghc;
os = "macos-14";
}) (builtins.filter (ghc: lib.versionOlder ghc "9.4")
self.lib.nonNixTestedGhcVersions);
})
./hackage-publish.nix
./hlint.nix
];
imports = [./hlint.nix];

## dependency management
services.renovate.enable = true;
Expand All @@ -77,115 +23,70 @@ in {
# This should default by whether there is a .git file/dir (and whether it’s
# a file (worktree) or dir determines other things – like where hooks
# are installed.
git = {
enable = true;
ignores = [
# Cabal build
"dist-newstyle"
];
};
git.enable = true;
};

## formatting
editorconfig.enable = true;

programs = {
treefmt = {
enable = true;
## Haskell formatter
programs.ormolu.enable = true;
settings.formatter.prettier.excludes = ["*/docs/license-report.md"];
};
vale = {
enable = true;
excludes = [
"*.cabal"
"*.hs"
"*.lhs"
"./cabal.project"
];
formatSettings."*"."Microsoft.Auto" = "NO";
vocab.${config.project.name}.accept = [
"bugfix"
"coalgebra"
"coinductive"
"comonad"
"compdata"
"conditionalize"
"Droste"
"effectful"
"Elgot"
"functor"
"GADT"
"Kleisli"
"Kmett"
"metamorphism"
"parameterize"
"polykind"
"[Yy]aya"
];
};
treefmt.enable = true;
vale.enable = true;
};

## CI
services.garnix = {
enable = true;
builds = {
## TODO: Remove once garnix-io/garnix#285 is fixed.
exclude = ["homeConfigurations.x86_64-darwin-example"];
include = lib.mkForce (
[
"homeConfigurations.*"
"nixosConfigurations.*"
]
++ flaky.lib.forGarnixSystems supportedSystems (
sys:
[
"checks.${sys}.*"
"devShells.${sys}.default"
"packages.${sys}.default"
]
++ lib.concatMap (ghc: [
"devShells.${sys}.${ghc}"
"packages.${sys}.${ghc}_all"
])
(self.lib.testedGhcVersions sys)
)
);
};
};
services.garnix.enable = true;
## FIXME: Shouldn’t need `mkForce` here (or to duplicate the base contexts).
## Need to improve module merging.
services.github.settings.branches.main.protection.required_status_checks.contexts =
lib.mkForce
(["check-bounds"]
([
"All Garnix checks"
"check-bounds"
"check-licenses"
]
++ lib.concatMap (sys:
lib.concatMap (ghc: [
"build (${ghc}, ${sys})"
"build (--prefer-oldest, ${ghc}, ${sys})"
])
self.lib.nonNixTestedGhcVersions)
githubSystems
++ flaky.lib.forGarnixSystems supportedSystems (sys:
lib.concatMap (ghc: [
"devShell ${ghc} [${sys}]"
"package ${ghc}_all [${sys}]"
])
(self.lib.testedGhcVersions sys)
++ [
"homeConfig ${sys}-${config.project.name}-example"
"package default [${sys}]"
## FIXME: These are duplicated from the base config
"check formatter [${sys}]"
"check project-manager-files [${sys}]"
"check vale [${sys}]"
"devShell default [${sys}]"
]));
self.lib.githubSystems);
services.haskell-ci = {
inherit (self.lib) defaultGhcVersion extraDependencyVersions;
systems = self.lib.githubSystems;
ghcVersions = self.lib.nonNixTestedGhcVersions;
cabalPackages = {
yaya = "core";
yaya-containers = "containers";
yaya-hedgehog = "hedgehog";
yaya-quickcheck = "quickcheck";
yaya-unsafe = "unsafe";
};
latestGhcVersion = "9.10.1";
exclude = [
## TODO: This particular combination requires libgmp.
{
bounds = "--prefer-oldest";
ghc = "8.6.1";
os = "macos-13";
}
## TODO: This build often hangs for some reason.
{
bounds = "--prefer-oldest";
ghc = "8.8.1";
os = "windows-2022";
}
## TODO: For some reason, this combination fails to build
## ghc-paths-0.1.0.12.
{
ghc = "9.4.1";
os = "macos-14";
}
];
};

## publishing
# NB: Can’t use IFD on FlakeHub (see DeterminateSystems/flakehub-push#69), so
# this is disabled until we have a way to build Haskell without IFD.
services.flakehub.enable = false;
services.github.enable = true;
services.github.settings.repository.topics = ["recursion-schemes"];
}
Loading

0 comments on commit c56cd27

Please sign in to comment.