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

Repair the Nix flake #4923

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open

Conversation

sellout
Copy link
Contributor

@sellout sellout commented May 8, 2024

Overview

This does the minimum to get nix flake check working.

The primary issue is that the standard flake outputs require flat package sets, and this flake produced nested ones.

Fixes #4940.

Implementation notes

This merges package sets into a single one rather than making them separate entries in the outputs.

The only other change was to correct the attribute name used for the UCM docker image’s command.

Interesting/controversial decisions

This currently flattens the package sets and adds prefixes to them, for some conceptual groupings. The prefixes could be removed, though.

Also, if we wanted to maintain some of the nesting, we could use the legacyPackages output, but that is (as it says) legacy, and either way it’s breaking the names, so we might as well just adopt the current flat style.

Test coverage

This adds a garnix config to have CI build & test as much as possible from the flake. These checks run on my fork, but garnix would need to be enabled for unisonweb to get it running here.

By default, [garnix]() would check all the packages, but only on x86_64-linux. This
ensures they’re also checked on aarch64-darwin (the only other platform
supported by both this repo and garnix).

[The garnix-ci GitHub app](https://github.com/apps/garnix-ci) must also be
enabled on this repo for it to run (although for this PR, the results from my
fork should be visible).
This does the minimum to get `nix flake check` working.;

The primary issue is that flakes require flat package sets, and this flake
produced nested ones. This flattens the package sets without renaming anything.
E.g., `packages.${system}.docker.ucm` is now `packages.${system}.ucm`, and
similar for other derivations.

The only other change was to correct the attribute name for the UCM docker
image’s command.
This adds some grouping to the outputs, since they can’t be grouped in attribute
sets.

It also updates the relevant docs with the new names.

Here are the renamings:
- `packages.haskell-nix.some:cabal:thing`→ `packages.component-some:cabal:thing`
- `packages.docker.ucm` → `packages.docker-ucm`
- `apps.haskell-nix.some:cabal:thing` → `apps.component-some:cabal:thing`, and
- `devShells.haskell-nix.unison-cli` → `devShells.cabal-unison-cli`.
@sellout
Copy link
Contributor Author

sellout commented May 24, 2024

I can also remove the garnix config before merging. I mostly have it to make sure I’m getting decent coverage on the Nix bits. But it looks like there’s already some of that in GitHub workflows.

@sellout sellout marked this pull request as ready for review May 24, 2024 21:15
@sellout sellout requested review from ceedubs and aryairani May 24, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nix flake is invalid
1 participant