diff --git a/.github/workflows/nix-linux.yml b/.github/workflows/nix-linux.yml index 3f35c602cd..dbb1c883fe 100644 --- a/.github/workflows/nix-linux.yml +++ b/.github/workflows/nix-linux.yml @@ -19,4 +19,4 @@ jobs: fetch-depth: 0 - uses: DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e - uses: DeterminateSystems/magic-nix-cache-action@eeabdb06718ac63a7021c6132129679a8e22d0c7 - - run: nix build --print-build-logs --show-trace + - run: nix flake check -L --show-trace diff --git a/flake.nix b/flake.nix index 264dd1d1f4..a0a9cec419 100644 --- a/flake.nix +++ b/flake.nix @@ -67,7 +67,7 @@ version = "unstable-${self.shortRev or "dirty"}"; buildFeatures = [ "packaging" ]; - cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors + cargoBuildFlags = [ "--bin" "jj" ]; # don't build and install the fake editors useNextest = true; src = filterSrc ./. [ ".*\\.nix$" @@ -110,11 +110,28 @@ }; default = self.packages.${system}.jujutsu; }; + apps.default = { type = "app"; program = "${self.packages.${system}.jujutsu}/bin/jj"; }; + formatter = pkgs.nixpkgs-fmt; + + checks.jujutsu = self.packages.${system}.jujutsu.overrideAttrs ({ ... }: { + # FIXME (aseipp): when running `nix flake check`, this will override the + # main package, and nerf the build and installation phases. this is + # because for some inexplicable reason, the cargo cache gets invalidated + # in between buildPhase and checkPhase, causing every nix CI build to be + # 2x as long. + buildPhase = "true"; + installPhase = "touch $out"; + # NOTE (aseipp): buildRustPackage also, by default, runs `cargo check` + # in `--release` mode, which is far slower; the existing CI builds all + # use the default `test` profile, so we should too. + cargoCheckType = "test"; + }); + devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ # The CI checks against the latest nightly rustfmt, so we should too.