162 days ago · 14 min read2762 words · Tech · hide · Fediverse post

In the previous post, we learned how to get started with managing and building a Haskell project with Nix. In this post, we learn how to easily create statically-linked executables for Haskell projects with Nix. This post was originally published on abhinavsarkar.net. This post is a part of the series: Nix for Haskell. Getting Started Static Builds 👈 ContentsStatic BuildsEnabling Static Builds in GHCConfiguring the ApplicationRooting Static Build DependenciesFinaleBonus: Building a Docker ImageConclusion I recommend going through the previous post, because we are going to start off from where we left last time (ignoring the bonus sections). This is how our project’s directory tree looks at this point: . ├─ app │ └─ Main.hs ├─ ftr.cabal ├─ nix │ ├─ nixpkgs.nix │ ├─ sources.json │ └─ sources.nix ├─ package.nix └─ shell.nix Main.hs is the default generated main file that prints “Hello, Haskell!”. ftr.cabal is the default generated Cabal file. sources.(json|nix) are generated by Niv to…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town