Skip to content

nix develop --build and phases confusion #6202

@thufschmitt

Description

@thufschmitt

When buildPhase is defined, nix develop --build does not work due to confusion between the variable and function during stdenv eval.

{
  description = "A flake that uses Hello World";
  # inputs.flake01.url = "/tmp/flake01";
  outputs = { self, nixpkgs }: {
    defaultPackage.x86_64-linux =
      with import nixpkgs { system = "x86_64-linux"; };
      stdenv.mkDerivation {
        name = "flake02";
        src = ./d;
        buildInputs = [ hello ];
        buildPhase = ''
          hello >> ./hello.txt
        '';
        installPhase = ''
          mkdir -p $out
          install -m 644 -t $out/ hello.txt
        '';
      };
  };
}

need feedback:
flox@c03252c

Or change the order here in stdenv? https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L72-L80

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-cliRelating to the "nix" commandnix-shellnix-shell, nix develop, nix print-dev-env, etc
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions