GithubHelp home page GithubHelp logo

gazelle_nixos_repro's Introduction

Similarly to what is done in rules_haskell, we would like to setup buildifier in a project that supports NixOS as well as other linux platforms (that may or may not have nix installed globally).

There are multiple cases:

  • On NixOS we cannot use toolchains downloaded by rules_go and want to use a toolchain installed via rules_nixpkgs using nixpkgs_go_configure.
  • On regular linux without nix installed we want to use a toolchain downloaded by rules_go.
  • On regular linux with nix installed both would work so I think it's ultimately up to the project to decide. Here, similarly to what we do in rules_haskell, we would like to use the nix toolchain iff the user uses a nix shell provided with the project (i.e. if the IN_NIX_SHELL variable is set).

Usage

To use the nix toolchain (required on NixOS):

IN_NIX_SHELL=1 bazel build //:buildifier --host_platform=@rules_nixpkgs_core//platforms:host

To use the toolchain downloaded by rules_go (required if nix is not installed):

bazel build //:buildifier

Toolchains declared by rules_nixpkgs_go

I did not try it yet, but with this custom tag api, the rules_nixpkgs_go module could also register toolchains itself on platforms where nix is supported. And users would have a way to override these if needed, by declaring their own host, download or custom toolchain.

versions

bazel version = 6.1.0

gazelle_nixos_repro's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.