Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { pkgs, ... }:
- let
- # This is a neat trick that clever taught me on #nixos. Here we
- # re-import nixpkgs (using our fixed nixpkgs via pkgs.path) and
- # force the system to be x86_64-linux, which in turn causes this
- # derivation always to be built on x86_64-linux, regardless of the
- # system it was intended to be built for (as long as we use
- # nixpkgs.x instead of pkgs.x in the derivation!).
- #
- # We do this because dhall-nix doesn't build on aarch64-linux due to
- # GHC currently being unsupported on that arch; and Nixpkgs will
- # attempt to build any config that's needed on an aarch64-linux on
- # an aarch64-linux... unless we use this trick.
- #
- # This is effectively equivalent to Debian's "all"
- # pseudo-architecture.
- nixpkgs = import pkgs.path { system = "x86_64-linux"; };
- state =
- let
- drv = nixpkgs.stdenv.mkDerivation {
- name = "foo.nix";
- src = ./.;
- buildCommand = ''
- dhall-to-nix <<< $src/foo.dhall > $out
- '';
- buildInputs = [ nixpkgs.dhall-nix ];
- };
- in
- import "${drv}";
- in
- state
Add Comment
Please, Sign In to add comment