nix-shell -p cabal2nix
cabal2nix --no-check ./. > default.nix
nix-shell -p cabal2nix
cabal2nix --shell --no-check ./. > shell.nix
Don't just build using Cabal!! it will take forever because of Pandoc.
Build in Nix environment
# Enter Nix environment defined in shell.nix
nix-shell
# Use executable
answers-script ...
nix-shell
cabal --enable-nix test
TAR="https://github.com/ingun37/answers-script/archive/refs/tags/1.0.1.tar.gz"
# sandboxing
nix-shell -p "with import <nixpkgs> {}; let f = import (fetchTarball $TAR); in haskellPackages.callPackage f {}"
# no sandboxing
nix-env --install -E "with import <nixpkgs> {}; let f = import (fetchTarball $TAR); in _: (haskellPackages.callPackage f {})"