purescript / registry-dev

Development work related to the PureScript Registry
https://github.com/purescript/registry
95 stars 80 forks source link

Flake filesets + Flake check refactor + check Nix formatting #685

Closed toastal closed 6 months ago

toastal commented 7 months ago

If Microsoft GitHub supported stacked diffs this would look less bad… this is meant to be read patch by patch, including the patch message (not just title) where it’s actually not too bad to read IMO.

Anyhow: I was looking to do a bit of hacking on this project, but the Nix build times & flake check timings were slow (CONTRIBUTING says to run nix flake check) & the Nix formatting was inconsistent unlike the PureScript.

Highlights:

Questions / follow-ups:

Notes:

toastal commented 7 months ago

Hold up… tiny tweak needed to delete a line.

toastal commented 7 months ago

check nix-format

Cute. The CI already shows it.

thomashoneyman commented 7 months ago

Thanks for this work! I will give it a proper review this week.

In the meantime — totally fine to upgrade to 23.11, there isn’t a specific reason to avoid upgrades. The VM uses 23.11 so we can test the same configuration that the server uses. This repository deploys on commits to master.

At a glance I’m in favor of the changes you’ve made. I’m but a mere Nix dabbler so most of this looks like optimizations I ought to have made from the start.

toastal commented 7 months ago

@thomashoneyman I ‘snuck’ in a commit about system.stateVersion moving to 23.11 as you mentioned. Tests passing locally.

thomashoneyman commented 7 months ago

@toastal Oh, I thought you meant using nixpkgs 23.11 — while I think it’s fine to change the state version (we’re not using anything that relies on it that I know of, like postgres) I don’t see the harm in leaving that alone. What’s the advantage of changing it?

toastal commented 7 months ago

What it will affect the most is the modules where settings can change if packages are updated & their configs don’t match. Keeping the packages & state in sync isn’t the worst idea. Sorry if I misunderstood what you meant. -- toastal ไข่ดาว | https://toast.al PGP: 7944 74b7 d236 dab9 c9ef e7f9 5cce 6f14 66d4 7c9e

toastal commented 7 months ago

@thomashoneyman hold on… I re-read & now I’m re-unclear. Do you want me to drop b2fa76d5a7cf5c6279afb480cce8378954ff47f3 (system.stateVersion: 23.05 → 23.11) or no?

thomashoneyman commented 7 months ago

It’s ok to upgrade that field since we’re not using anything that’s reliant on the state version. (Yet, at least.)

thomashoneyman commented 6 months ago

There are options to fix the situation, but it involves modifying .tidyrc.json or relaxing .editorconfig :| As it stands, the project isn’t compliant with its .editorconfig.

The source of truth is the .tidyrc so we should relax .editorconfig in that case. We don't use unicode symbols in the codebase.

toastal commented 6 months ago

cool