diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 4f569c360..6463e0bb4 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -131,7 +131,6 @@ jobs: run: | nix build -L --no-link \ .#checks.${{ matrix.system }}.smoke \ - .#checks.${{ matrix.system }}.formatting \ .#checks.${{ matrix.system }}.repo-hygiene - name: Smoke-test diff --git a/README.md b/README.md index 8921dfaf1..93184c10f 100644 --- a/README.md +++ b/README.md @@ -110,18 +110,6 @@ npm run check # Lint, format, and type check ./pi-test.sh # Run pi from sources (can be run from any directory) ``` -### Nix development shell - -The flake provides the same toolchain without npm-managed binaries. Node.js 22 -and the Biome version pinned in `package.json` come from Nix, so `nix fmt` and -`npm run check` format the same way. - -```bash -nix develop # Shell with Node.js, Biome, and treefmt -nix fmt # Format JavaScript, TypeScript, JSON, CSS, and Nix -nix flake check # Build pi, then run the smoke, formatting, and hygiene checks -``` - ### Using local packages outside the monorepo Build every public package into one coherent local artifact set: diff --git a/flake.nix b/flake.nix index 6de98a81e..61c780f97 100644 --- a/flake.nix +++ b/flake.nix @@ -36,9 +36,6 @@ forAllSystems = genAttrs platforms; piOverlay = _final: prev: { - biome = prev.callPackage ./nix/biome.nix { - inherit source; - }; pi = prev.callPackage ./nix/package.nix { inherit source packageJson platforms; nodejs = prev.nodejs_22; @@ -49,19 +46,11 @@ system: let pkgs = (nixpkgsFor system).extend piOverlay; - inherit (pkgs) pi; - nodejs = pkgs.nodejs_22; - treefmtWrapper = import ./nix/treefmt.nix { inherit pkgs; }; - devShell = import ./nix/devshell.nix { inherit pkgs nodejs treefmtWrapper; }; in { - inherit - pkgs - pi - nodejs - devShell - treefmtWrapper - ; + inherit pkgs; + inherit (pkgs) pi; + nodejs = pkgs.nodejs_22; } ); in @@ -69,12 +58,7 @@ checks = forAllSystems ( system: import ./nix/checks.nix { - inherit (perSystem.${system}) - pkgs - pi - nodejs - treefmtWrapper - ; + inherit (perSystem.${system}) pkgs pi nodejs; inherit source; } ); @@ -84,12 +68,6 @@ pi = perSystem.${system}.pi; }); - devShells = forAllSystems (system: { - default = perSystem.${system}.devShell; - }); - - formatter = forAllSystems (system: perSystem.${system}.treefmtWrapper); - apps = forAllSystems (system: rec { default = pi; pi = { diff --git a/nix/biome.nix b/nix/biome.nix deleted file mode 100644 index 22514ff2c..000000000 --- a/nix/biome.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - autoPatchelfHook, - source, -}: -let - inherit (lib) importJSON optionals licenses; -in -stdenv.mkDerivation (finalAttrs: { - pname = "biome"; - version = (importJSON "${source}/package.json").devDependencies."@biomejs/biome"; - - src = - finalAttrs.passthru.sources.${stdenv.hostPlatform.system} - or (throw "Unsupported system for Biome: ${stdenv.hostPlatform.system}"); - - nativeBuildInputs = optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = optionals stdenv.hostPlatform.isLinux [ stdenv.cc.cc.lib ]; - - installPhase = '' - runHook preInstall - install -Dm755 biome $out/bin/biome - runHook postInstall - ''; - - passthru.sources = { - x86_64-linux = fetchurl { - url = "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-${finalAttrs.version}.tgz"; - hash = "sha256-2k7rG5YgEyMtJ7jAI+JWPzWhdxlNZI6TqyMVngU9Dus="; - }; - aarch64-linux = fetchurl { - url = "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-${finalAttrs.version}.tgz"; - hash = "sha256-cLKXQ7uIyS2aQ7P95IHh7A7hI7z89p8WUKeYW3/4N/I="; - }; - x86_64-darwin = fetchurl { - url = "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-${finalAttrs.version}.tgz"; - hash = "sha256-cD7JJVxSXEAQnYSgWAbOC1EPJ+M0+q7h0xg57OXao4o="; - }; - aarch64-darwin = fetchurl { - url = "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-${finalAttrs.version}.tgz"; - hash = "sha256-sMi2Aywy3UnD9hQPyroTMPfCsFSZKRqqnb8uC5oNX34="; - }; - }; - - meta = { - description = "Toolchain of the web"; - homepage = "https://biomejs.dev/"; - license = licenses.mit; - platforms = builtins.attrNames finalAttrs.passthru.sources; - mainProgram = finalAttrs.pname; - }; -}) diff --git a/nix/checks.nix b/nix/checks.nix index f6a4d7099..ea640787a 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -1,7 +1,6 @@ { pkgs, pi, - treefmtWrapper, source, nodejs, }: @@ -18,27 +17,6 @@ touch $out ''; - formatting = - pkgs.runCommand "pi-formatting-check" - { - nativeBuildInputs = [ - treefmtWrapper - pkgs.git - ]; - } - '' - export HOME=$(mktemp -d) - mkdir repo && cd repo - cp -r ${source}/. . - chmod -R +w . - git init -q - git config user.email "test@example.com" - git config user.name "Test" - git add . - treefmt --ci - touch $out - ''; - repo-hygiene = pkgs.runCommand "pi-repo-hygiene-check" { diff --git a/nix/devshell.nix b/nix/devshell.nix deleted file mode 100644 index 7c3ea80f9..000000000 --- a/nix/devshell.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - pkgs, - nodejs, - treefmtWrapper, -}: -let - inherit (pkgs.lib) getExe; -in -pkgs.mkShell { - packages = [ - nodejs - pkgs.git - pkgs.biome - treefmtWrapper - ]; - - shellHook = '' - export BIOME_BINARY="${getExe pkgs.biome}" - git config core.hooksPath .husky - ''; -} diff --git a/nix/treefmt.nix b/nix/treefmt.nix deleted file mode 100644 index 7b51549cc..000000000 --- a/nix/treefmt.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs }: -pkgs.treefmt.withConfig { - runtimeInputs = with pkgs; [ - biome - nixfmt - ]; - settings = { - global.tree_root_file = "flake.nix"; - formatter = { - biome = { - command = "biome"; - options = [ - "format" - "--write" - "--no-errors-on-unmatched" - ]; - includes = [ - "*.cjs" - "*.css" - "*.cts" - "*.graphql" - "*.js" - "*.json" - "*.jsonc" - "*.mjs" - "*.mts" - "*.ts" - ]; - }; - nixfmt = { - command = "nixfmt"; - includes = [ "*.nix" ]; - }; - }; - }; -}