Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into more-instances
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Mar 12, 2024
2 parents fd28f56 + cfa7e77 commit c4cdea5
Show file tree
Hide file tree
Showing 25 changed files with 202 additions and 1,727 deletions.
1 change: 1 addition & 0 deletions .config/project/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

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

Expand Down
50 changes: 50 additions & 0 deletions .config/project/hackage-publish.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
lib,
pkgs,
self,
...
}: let
packagesPath = "\${{ runner.temp }}/packages/";
in {
services.github.workflow."hackage-publish.yml".text = lib.generators.toYAML {} {
name = "Publish release to Hackage";
on = {
push.tags = ["v?[0-9]+.[0-9]+.[0-9]+*"];
workflow_dispatch.inputs.tag = {
description = "The existing version to publish to Hackage";
type = "string";
required = true;
};
};
jobs.hackage-publish = {
runs-on = "ubuntu-latest";
permissions = {
id-token = "write";
contents = "read";
};
steps = [
{
uses = "actions/checkout@v4";
"with".ref = "\${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}";
}
{
uses = "haskell-actions/setup@v2";
id = "setup-haskell-cabal";
"with" = {
ghc-version = lib.last self.lib.nonNixTestedGhcVersions;
cabal-version = pkgs.cabal-install.version;
};
}
{run = "cabal v2-sdist --output-directory='${packagesPath}' all";}
{
uses = "haskell-actions/hackage-publish@v1";
"with" = {
inherit packagesPath;
hackageToken = "\${{ secrets.HACKAGE_AUTH_TOKEN }}";
publish = false;
};
}
];
};
};
}
1 change: 1 addition & 0 deletions .gitattributes

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

1 change: 1 addition & 0 deletions .github/workflows/hackage-publish.yml

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

2 changes: 0 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ tests: True
packages:
./containers/yaya-containers.cabal
./core/yaya.cabal
./core-test/yaya-test.cabal
./hedgehog/yaya-hedgehog.cabal
./quickcheck/yaya-quickcheck.cabal
./unsafe/yaya-unsafe.cabal
./unsafe-test/yaya-unsafe-test.cabal
3 changes: 0 additions & 3 deletions containers/yaya-containers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ build-type: Custom
license: AGPL-3.0-or-later
license-files:
LICENSE
extra-source-files:
CHANGELOG.md
README.md
tested-with:
GHC == {
-- GHCup Nixpkgs
Expand Down
661 changes: 0 additions & 661 deletions core-test/LICENSE

This file was deleted.

175 changes: 0 additions & 175 deletions core-test/yaya-test.cabal

This file was deleted.

2 changes: 2 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Recursion schemes allow you to separate _any_ recursion from your business logic

How's this possible? You can’t have totality _and_ Turing-completeness, can you? Oh, but [you can](https://pdfs.semanticscholar.org/e291/5b546b9039a8cf8f28e0b814f6502630239f.pdf) – there is a particular type, `Partial a` (encoded with a fixed-point) that handles potential non-termination, akin to the way that `Maybe a` handles exceptional cases. It can be folded into `IO` in your main function, so that the runtime can execute a Turing-complete program that was modeled totally.

**NB**: The tests for this package are unfortunately included in `yaya-hedgehog` instead, to avoid a dependency cycle.

## organization

This organization is intended to make this a lightly-opinionated library. You should only need to import one module (per package) into any module of yours.
Expand Down
30 changes: 15 additions & 15 deletions flake.lock

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

36 changes: 8 additions & 28 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,14 @@

supportedSystems = flaky.lib.defaultSystems;

cabalPackages = pkgs: hpkgs: let
packages =
concat.lib.cabalProject2nix
./cabal.project
pkgs
hpkgs
(old: {
configureFlags = old.configureFlags ++ ["--ghc-options=-Werror"];
});
in
packages
// {
"${pname}-test" = self.lib.testOnly packages."${pname}-test";
"${pname}-unsafe-test" =
self.lib.testOnly packages."${pname}-unsafe-test";
};
cabalPackages = pkgs: hpkgs:
concat.lib.cabalProject2nix
./cabal.project
pkgs
hpkgs
(old: {
configureFlags = old.configureFlags ++ ["--ghc-options=-Werror"];
});
in
{
schemas = {
Expand Down Expand Up @@ -167,18 +159,6 @@
supportedSystems);

lib = {
## TODO: Move upstream.
## Don’t install this Haskell package – it only contains test suites.
testOnly = drv:
drv.overrideAttrs (old: {
installPhase = ''
runHook preInstall
mkdir -p "$out"
runHook postInstall
'';
outputs = ["out"];
});

## TODO: Extract this automatically from `pkgs.haskellPackages`.
defaultCompiler = "ghc948";

Expand Down
Loading

0 comments on commit c4cdea5

Please sign in to comment.