Skip to content

nix flake check --store not working #16054

Description

@yajo

Describe the bug

nix flake check behaves very different with remote store than nix build commands.

Steps To Reproduce

Create this example flake:

{
  description = "A flake with a check that always fails";

  outputs = {nixpkgs, ...}: let
    forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"];
  in {
    checks = forAllSystems (system: let
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      default = pkgs.runCommand "failing-check" {} ''
        exit 1
      '';
    });
  };
}

Checking with remote store just hangs: nix flake check --store ssh-ng://eu.nixbuild.net

Adding local eval does not trigger builds: nix flake check --store ssh-ng://eu.nixbuild.net --eval-store auto

Local eval and store triggers builds as expected: nix flake check

Using the equivalent nix build commands trigger builds as expected:

  • nix build --store ssh-ng://eu.nixbuild.net .#checks.x86_64-linux.default
  • nix build --store ssh-ng://eu.nixbuild.net --eval-store auto .#checks.x86_64-linux.default

Expected behavior

Builds for supported arch(es) should be triggered with nix flake check always, unless --no-build is explicitly passed.

Metadata

nix-env (Nix) 2.34.7

Additional context

I'm trying to use nixbuild's remote store solution for fast CI.

I'd love to be able to just use this command on my CI:

nix flake check --all-systems --store ssh-ng://eu.nixbuild.net --eval-store auto --builders ''

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions