tweag / nix_bazel_codelab

Nix+Bazel Codelab
Apache License 2.0
50 stars 4 forks source link

Automatically detect NixOS platform #18

Open fricklerhandwerk opened 2 years ago

fricklerhandwerk commented 2 years ago

Is your feature request related to a problem? Please describe. Running the codelab on NixOS requires a manual step.

Describe the solution you'd like Provide a wrapper for http_archive that additionally takes a mapping of platforms to a list of patches. See _detect_host_platform() in rules_nixpkgs for an example, or is_supported_platform() for a much simpler one.

Another way to detect NixOS: https://discourse.nixos.org/t/detect-that-bash-script-is-running-under-nixos/11402

Describe alternatives you've considered Keep the manual step. Whoever uses NixOS will be confident enough to uncomment two lines in WORKSPACE.