Skip to content

Autosourcing commands from nix-index & nix-index-databse #232

@blaggacao

Description

@blaggacao

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

Treefmt is a great tool, but it doesn't take away the burdon of sourcing the used commands.

However, in UX categories, that would be in the ballpark of 50% of additional value (see Devenv, Fleek, Bob, etc).

treefmt-nix doesn't cut the deal, because it requires mental overhead, is not dead simple and interferes with my nix-lib project intent which is not commonly about boilerplate tooling or potentially not a nix project at all.

Describe the solution you'd like

  1. Setup and maintenance of CI should be as simple as:
      - name: Install nix
        uses: nixbuild/nix-quick-install-action@v22
      - name: Check formatting
        run: nix run nixpkgs#treefmt -- . --fail-on-change --no-cache

(non-pinning related issues with the tooling formatting are a rare "black-swan" in the horizons of this lifecycle, so we accept them in turn for the 50% additional UX)

  1. Set up and usage of treefmt should be as easy as:
  • add treefmt.toml
  • run treefmt
    • for Nix users which nix, this means feature-flagged (on which nix) profit
    • for no-nix users, this means no deterioration of their current expectations and a pretext to sh <(curl -L https://nixos.org/nix/install), which might be a faster resolution of their problem at hand than any alternative course of action.

Describe alternatives you've considered

treefmt-nix, manual management. It doesn't cut the deal, because it doesn't keep out of my way.

Additional context

I want to do a PR / contribution. Would it be accepted?

nix-community/nix-index-database#44

In Github Actions a hypothetical and arbitrarily pinned nix/nixpkgs could speed up time-to-first-feedback some bits on style checks as it would already have nixpkgs downloaded` and - alas - eval cached.

Potentially, this implementation could attempt to fetch static builds where available to improve the situation further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions