4 ms·
To truly appreciate what nix provides, take a look at this example script that uses nix-shell as interpreter and marvel at the fact that running it is as simple
by aszen 6y ago
To truly appreciate what nix provides, take a look at this example script that uses nix-shell as interpreter and marvel at the fact that running it is as simple as running a binary after you have nix installed.
```
#!/usr/bin/env nix-shell
#!nix-shell -p "(pkgs.haskellPackages.ghcWithPackages (ps: [ ps.text ]))"
#!nix-shell -i runghc
{-# LANGUAGE OverloadedStrings #-}
import Data.Text.IO
main :: IO ()
main = Data.Text.IO.putStrLn "Hello, World!"
```
While nix is sometimes hard to learn, it is often a much simpler solution and it works for all languages so learning it is well worth it.