Skip to content

Commit

Permalink
Merge pull request tweag#63 from tweag/nin-update-unsupported-platforms
Browse files Browse the repository at this point in the history
Generalize unsupported platforms
  • Loading branch information
Félix Baylac-Jacqué authored Jan 25, 2019
2 parents c232b29 + 82e5ace commit 914f8f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,21 @@ nixpkgs_local_repository = repository_rule(
},
)

def _is_supported_platform(repository_ctx):
if repository_ctx.execute(["nix-build","--version"]).return_code == 0:
nix_in_path = True
else:
nix_in_path = False
is_windows = repository_ctx.os.name.startswith("windows")
return (not is_windows) and nix_in_path


def _nixpkgs_package_impl(repository_ctx):
repository = repository_ctx.attr.repository
repositories = repository_ctx.attr.repositories

# Is nix supported on this platform?
not_supported = repository_ctx.os.name.startswith("windows")
not_supported = not _is_supported_platform(repository_ctx)
# Should we fail if Nix is not supported?
fail_not_supported = repository_ctx.attr.fail_not_supported

Expand Down

0 comments on commit 914f8f5

Please sign in to comment.