Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .cache/vale/Vocab/dada/accept.txt

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

27 changes: 27 additions & 0 deletions .cache/vale/config/vocabularies/dada/accept.txt

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

1 change: 0 additions & 1 deletion .config/mustache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ project:
name: "dada"
repo: "sellout/dada"
summary: "A total recursion scheme library for Dhall"
version: "0.1.0"
type: { name: "dhall" }
153 changes: 54 additions & 99 deletions .config/project/default.nix
Original file line number Diff line number Diff line change
@@ -1,115 +1,70 @@
{config, flaky, lib, pkgs, self, ...}: {
### All available options for this file are listed in
### https://sellout.github.io/project-manager/options.xhtml
{
config,
lib,
self,
...
}: {
imports = [./hlint.nix];

project = {
name = "dada";
summary = "A total recursion scheme library for Dhall";

devPackages = [
pkgs.cabal-install
pkgs.dhall
pkgs.dhall-docs
pkgs.dhall-lsp-server
pkgs.graphviz
];
};

imports = [
./github-ci.nix
./github-pages.nix
./hlint.nix
];

## dependency management
services.renovate.enable = true;

## development
programs = {
direnv.enable = true;
# 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"
];
};
};

## formatting
editorconfig.enable = true;

programs = {
treefmt = {
enable = true;
programs = {
dhall.enable = true;
## Haskell formatter
ormolu.enable = true;
## TODO: Move something like this to Flaky.
file = let
copyLicenses = dir: {
"${dir}/LICENSE".source = ../../LICENSE;
"${dir}/LICENSE.AGPL-3.0-only".source = ../../LICENSE.AGPL-3.0-only;
"${dir}/LICENSE.Universal-FOSS-exception-1.0".source =
../../LICENSE.Universal-FOSS-exception-1.0;
"${dir}/LICENSE.commercial".source = ../../LICENSE.commercial;
};
settings.formatter.dhall.includes = ["dhall/*"];
};
vale = {
enable = true;
excludes = [
"*.cabal"
"*.hs"
"*.lhs"
"*/.dir-locals.el"
"./.shellcheckrc"
"./cabal.project"
"./dhall/*"
];
vocab.${config.project.name}.accept = [
"bugfix"
"comonad"
"composability"
"conditionalize"
"Dhall"
"functor"
"GADT"
"Kleisli"
"Kmett"
"reusability"
];
};
in
{
".dir-locals.el".source = ../emacs/.dir-locals.el;
}
// copyLicenses "haskell";
};
project.file.".dir-locals.el".source = lib.mkForce ../emacs/.dir-locals.el;

## CI
services.garnix = {
enable = true;
builds.exclude = [
# TODO: Remove once garnix-io/garnix#285 is fixed.
"homeConfigurations.x86_64-darwin-${config.project.name}-example"
programs.vale = {
excludes = [
"*/LICENSE*"
];
vocab.${config.project.name}.accept = [
"APIs"
"bugfixes"
"composability"
"pragmas"
"reusability"
"widenings"
];
};

## CI
## 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
(map (ghc: "CI / build (${ghc}) (pull_request)") self.lib.nonNixTestedGhcVersions
++ lib.concatMap flaky.lib.garnixChecks (
([
"All Garnix checks"
"check-bounds"
"check-licenses"
]
++ lib.concatMap (sys:
lib.concatMap (ghc: [
(sys: "devShell ghc${ghc} [${sys}]")
(sys: "package ghc${sys}_all [${sys}]")
"build (${ghc}, ${sys})"
"build (--prefer-oldest, ${ghc}, ${sys})"
])
(self.lib.testedGhcVersions pkgs.system)
++ [
(sys: "homeConfig ${sys}-${config.project.name}-example")
(sys: "package default [${sys}]")
(sys: "package ${config.project.name} [${sys}]")
## FIXME: These are duplicated from the base config
(sys: "check formatter [${sys}]")
(sys: "devShell default [${sys}]")
]));

## publishing
programs.git.attributes = ["/dhall/** linguist-language=Dhall"];
services.flakehub.enable = true;
services.github.enable = true;
services.github.settings.repository = {
homepage = "https://sellout.github.io/${config.project.name}";
topics = ["library"];
self.lib.nonNixTestedGhcVersions)
config.services.haskell-ci.systems);
services.haskell-ci = {
inherit (self.lib) defaultGhcVersion;
ghcVersions = self.lib.nonNixTestedGhcVersions;
cabalPackages = {"${config.project.name}" = "haskell";};
extraDependencyVersions = ["doctest-0.24.0"];
latestGhcVersion = "9.10.1";
};

services.github.settings.repository.topics = ["recursion-schemes"];
}
6 changes: 5 additions & 1 deletion .config/project/github-ci.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{lib, self, ...}: {
{
lib,
self,
...
}: {
services.github.workflow."build.yml".text = lib.generators.toYAML {} {
name = "CI";
on = {
Expand Down
24 changes: 12 additions & 12 deletions .config/project/github-pages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ in {
{
uses = "cachix/install-nix-action@v24";
"with".extra_nix_config = ''
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
extra-substituters = https://cache.garnix.io
'';
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
extra-substituters = https://cache.garnix.io
'';
}
{
uses = "lriesebos/nix-develop-command@v1";
"with".command = ''
dhall-docs \
--input ./dhall \
--base-import-url "https://sellout.github.io/dada" \
--package-name "dada"
## We copy here to fix the permissions from the Nix symlinks
cp -r ./docs ./_site
chmod --recursive +rwx ./_site
cp -r ./dhall/* ./_site/
'';
dhall-docs \
--input ./dhall \
--base-import-url "https://sellout.github.io/dada" \
--package-name "dada"
## We copy here to fix the permissions from the Nix symlinks
cp -r ./docs ./_site
chmod --recursive +rwx ./_site
cp -r ./dhall/* ./_site/
'';
}
{
name = "Upload artifact";
Expand Down
Loading