Hello guys,
I am new to Nix (and to Haskell). I’ve been trying to learn Haskell on and off for some time. I am trying to build a static-site generator using Hakyll to build my blog; but the problem I am facing is that the executable built this way fails for unicode characters.
Here is the haskell project I am trying to build: github.com/channikhabra/brandi/
As per this issue: https://github.com/jaspervdj/hakyll/issues/614 (and some other similar issues), I have to set some environment variables to tell Hakyll (or haskell?) that it should support unicode.
Can you guys please help me with how I can set these env variables for building in my current setup? Or should I take some other approach to build my project? My current nix configuration is amalgamation of stuff I picked from here and there (sorry didn’t keep track of sources).
To save you guys a click, here is my release.nix:
let
sources = import ./nix/sources.nix;
in
{ compiler ? "ghc883"
, pkgs ? import sources.nixpkgs { }
}:
let
inherit (pkgs.haskell.lib) appendPatch appendConfigureFlags;
haskellPackages = pkgs.haskell.packages.${compiler}.override {
overrides = hpNew: hpOld: {
hakyll = hpOld.hakyll.overrideAttrs(oldAttrs: {
configureFlags = "-f watchServer -f previewServer";
patches = [ ./hakyll.patch ];
});
brandi = hpNew.callCabal2nix "brandi" ./. { };
niv = import sources.niv { };
};
};
project = pkgs.haskell.lib.justStaticExecutables haskellPackages.brandi;
in
{
project = project;
shell = haskellPackages.shellFor {
packages = p: with p; [
brandi
];
buildInputs = with haskellPackages; [
brandi
];
withHoogle = true;
};
dockerImage = pkgs.dockerTools.buildImage {
name = "channikhabra/brandi";
tag = "latest";
config = {
Cmd = [ "${project}/bin/brandi" "build" ];
WorkingDir = "/app";
Volumes = {
"/app" = {};
};
};
};
}
I believe one of the environment variables I want to set is LANG=en_US.UTF-8
.
Thank you in advance!