Skip to content

Instantly share code, notes, and snippets.

@bgamari
Last active May 27, 2020 15:04
Show Gist options
  • Save bgamari/734eb02ed7295aef935da837c0c20a92 to your computer and use it in GitHub Desktop.
Save bgamari/734eb02ed7295aef935da837c0c20a92 to your computer and use it in GitHub Desktop.
haskell-nix configuration for cross-compiling Hadolint
let
haskellNixSrc = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/a823ba4b7126d11ca272ef70b842b0ea5523fcfd.tar.gz;
haskellNix = import haskellNixSrc {};
nixpkgsSrc = haskellNix.sources.nixpkgs-2003;
nixpkgsArgs = haskellNix.nixpkgsArgs;
in
{ pkgs ? (import nixpkgsSrc nixpkgsArgs).pkgsCross.aarch64-multiplatform-musl
}:
let
hspkgs = pkgs.haskell-nix.stackProject {
src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
};
in hspkgs
# Optional: configure cachix as described in the documentation:
# https://github.com/input-output-hk/haskell.nix/#cache
# Build it!
$ nix build -f default.nix hadolint.components.exes.hadolint
$ file result/bin/hadolint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment