Skip to content

Improve flakes installables ergonomics, avoid nixpkgs# part? #4438

@dramforever

Description

@dramforever

Is your feature request related to a problem? Please describe.

It's kind of annoying to keep typing nixpkgs# over and over in situations like:

$ nix shell nixpkgs#wireshark
$ nix run nixpkgs#peek

Especially considering that # is kinda hard to type.

Describe the solution you'd like

I feel like this should just work:

$ nix shell wireshark
$ nix run peek

To achieve this, I'm thinking about this scheme:

  • If an INSTALLABLE does not contain either : or # looks like an attribute name like foo.bar.baz, resolve it to some default flake, like either flake:default#foo.bar.baz or flake:nixpkgs#foo.bar.baz
  • Otherwise treat it as we do now

I'm not sure if this is the intention, but I think I am going to use stuff under nixpkgs# far more than the various other flakes. When we do need other flakes, just put a # after the flake name, i.e. foo# still means flake:foo, and things like github:owner/repo still means that flake.

Describe alternatives you've considered

  • Give nixpkgs# a shorter name: Still a bit hard to type, even if it's just n#

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    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