Install NeoHaskell
You’ll use neo to create, build, and run NeoHaskell projects. To get started, check that Nix is ready, install neo and its companion neoctl, then check both versions in a new terminal.
Choosing your terminal
Section titled “Choosing your terminal”- Linux (x86-64 or ARM64): Open your usual terminal.
- macOS (Apple Silicon): Open Terminal.
- Windows (x86-64 or ARM64): Open your WSL2 Linux distribution. Run the installation and version checks inside that distribution.
Windows: setting up WSL2
New to WSL? Open PowerShell as an administrator and run wsl --install. Restart Windows when prompted, open Ubuntu from the Start menu, and create your Linux username and password.
Already using WSL? Run wsl --list --verbose in PowerShell. The version beside your distribution should be 2. For example, wsl --set-version Ubuntu 2 converts an existing Ubuntu distribution to WSL2.
Check the Linux service manager. Inside Linux, run cat /proc/1/comm. You should see systemd, the service manager that starts Nix. If your WSL2 distribution has systemd installed but prints init, set systemd=true in the [boot] section of /etc/wsl.conf. Save your work in all WSL terminals, run wsl --shutdown in PowerShell, then reopen Linux and repeat the check.
Use your usual account with a writable home directory. You’ll need an internet connection, curl, and either sha256sum or shasum to verify the download. Your login shell must be /bin/bash or /bin/zsh. If you use Zsh, it expects the startup files in your home directory, with ZDOTDIR unset.
1. Check Nix
Section titled “1. Check Nix”NeoHaskell uses multi-user Nix to download prebuilt tools. Run this command to see whether your account can reach the Nix background service:
nix --extra-experimental-features nix-command store info --store daemon --offline --json- The response includes
"url":"daemon". You’re ready for step 2. - The shell says
nix: command not found. If you haven’t installed Nix, open the instructions for your platform below. - Nix reports a connection or permission error. Ask your administrator to start the Nix daemon and give your account access. Repeat the check before continuing.
Install Nix on Linux or WSL2
Use the multi-user installer on a system with systemd, access to sudo, and SELinux disabled. If your system is managed, ask the administrator to provide multi-user Nix.
curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install | sh -s -- --daemonFollow the prompts, open a new Linux terminal, and repeat the Nix check.
Install Nix on Apple Silicon macOS
The current Nix installer requires macOS 14 or later.
curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install | shFollow the prompts, open a new Terminal window, and repeat the Nix check.
2. Install NeoHaskell
Section titled “2. Install NeoHaskell”-
Start the installer. Run this command as your usual user. It downloads and checks the installer for your machine.
Terminal curl -fsSL https://neohaskell.org/install | sh -
Review the changes. Look for the selected version and the shell settings that make both commands available. Press D for details. If the installer proposes a new source for prebuilt packages, it may ask for your administrator password and restart Nix. Let other Nix jobs finish before approving that restart. Press Enter to accept or Esc to decline.
-
Open a new terminal when the installer says the selected version is active. On Windows, reopen the same Linux distribution.
3. Check both versions
Section titled “3. Check both versions”Run both commands in the new terminal:
neo --versionneoctl --versionEach command prints its name and version. Here’s the expected output if you installed release 0.18.1:
0.18.1neo 0.18.1neoctl 0.18.1If both numbers match the release you installed, setup is complete. If either command is missing or prints another version, check which commands your shell found.
Git for your first project. Create a project uses Git to record the starter files. Run git --version to check that it’s available. If Git is missing, install it with your distribution’s package manager (for example, sudo apt install git on Ubuntu), or run xcode-select --install on macOS.
Troubleshooting
Section titled “Troubleshooting”A command is missing or has the wrong version
Section titled “A command is missing or has the wrong version”In a new terminal, check where your shell finds each tool:
command -v neocommand -v neoctlEach command should print a path. If a path points to an older installation, use its original installation method to remove the conflicting command. If a path is missing, check that you’re using the supported login shell and, on Windows, the distribution where you installed the tools. Rerun the installer, open a new terminal, and check both versions.
Nix can’t download a package
Section titled “Nix can’t download a package”If the installer offers to configure a cache for prebuilt packages, review the change. On a managed system, give the settings below to your administrator. Once the daemon has loaded them, retry the installation. If it still fails, keep the error message and the diagnostic report from the path the installer prints.
Nix settings for your administrator
Add any missing features, caches, and signing keys to the system daemon’s existing configuration. For standard multi-user Nix, this file is /etc/nix/nix.conf. On Windows, use the file inside the Linux distribution.
extra-experimental-features = nix-command flakesextra-substituters = https://neohaskell.cachix.org https://cache.iog.io https://cache.nixos.orgextra-trusted-public-keys = neohaskell.cachix.org-1:mo2cLaGbwqbrxs9xhqKK8jeNsn3osi7t6XoAmxSZssc= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=Apply the settings using the tool that manages the daemon. For a standard systemd installation, run sudo systemctl restart nix-daemon.service after other Nix jobs finish. On a Mac with standard multi-user Nix, restart the Mac.
Updates and removal
Section titled “Updates and removal”Updating both tools
Section titled “Updating both tools”When you’re ready for a newer release, run:
neo updateReview the proposed release. After accepting the update, open a new terminal and check both versions.
Uninstalling NeoHaskell
Section titled “Uninstalling NeoHaskell”To remove the managed commands and their shell setup, run:
neo uninstallReview the changes and press Enter to confirm. Your projects and Nix installation stay in place. If removal is interrupted, correct the reported problem and run neo uninstall again.