Skip to content

commands doesn't work when both package and command are set. #365

@landure

Description

@landure

Describe the bug

when describing a command with both package and command set, the package option is preferred to the command option.

This means that the command is not created with the expected name even if the name appears in the menu.

To Reproduce

Steps to reproduce the behavior:

        devshells.default.commands = [
          {
            name = "nil-diagnostics";
            command = ''
              shopt -s globstar
              ${getExe pkgs.nil} diagnostics ./**/*.nix
            '';
            package = pkgs.nil;
            category = "lint";
          }
        ];

The command appears in the menu, but nil-diagnostics isn't created.

Expected behavior

When both package and command are set, either:

  1. display an error that it's one or the other.
  2. create the command script, AND add both the command and package to the develop shell.

System information

nix --version
nix (Nix) 2.28.4

Additional context

devshell installed using flake parts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions