My follow along version of Learn Haskell.
External dependencies:
Note to self: can we somehow include direnv in flake and bootstrap it into vscode?
This project is defined with a Nix Flake. This flake takes care of downloading
all the Haskell dependencies. It also provides a shell environment for development
that have these dependencies available in the PATH
.
Before the flake can be used, check your system and change the system
variable
in outputs
to your system. Common values are:
aarch64-darwin
Apple Silicon MacOSx86_64-linux
For most Linux distro's and Windows WSL
When in doubt, start the Nix repl (nix repl
) and type: builtins.currentSystem
.
This shell environment can be accessed in a few different ways:
- Through VS Code with the direnv extension (see
.vscode/extensions.json
) - Through your normal shell with direnv
- Through your normal shell with
nix develop
(not recommended, as you won't have your normal shell config available there)
Very hacky stuff right now.
cabal run # Spits the generated html to stdout
cabal run > artifact/hello.html # Now we have the html (and sometimes some build output) in a file.
open artifact/hello.html # That we can open in our browser.
cabal
is available inside the devShell. In VS Code with direnv, you can
just run it in the VS Code Terminal.