Skip to content

Instantly share code, notes, and snippets.

@zeta-00
Created December 11, 2019 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeta-00/80eef20f776f08609a8a4d8c90e37206 to your computer and use it in GitHub Desktop.
Save zeta-00/80eef20f776f08609a8a4d8c90e37206 to your computer and use it in GitHub Desktop.
[root@nixos:/home/zeta/example_projects/simple_examples/my_script]# ls
default.nix my_script.hs
[root@nixos:/home/zeta/example_projects/simple_examples/my_script]# nix-shell
building '/nix/store/qxxl4jd1q2jpljl3b8ilz4spzhp0zp7c-cabal2nix-my_script.drv'...
installing
error: creating directory '/nix/var': Permission denied
error: creating directory '/nix/var': Permission denied
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
cabal2nix: user error (Failed to fetch source. Does this source exist? Source {sourceUrl = "/nix/store/0c335601jszw1kwkghn7qanzlrv40mdi-my_script", sourceRevision = "", sourceHash = Guess "", sourceCabalDir = ""})
builder for '/nix/store/qxxl4jd1q2jpljl3b8ilz4spzhp0zp7c-cabal2nix-my_script.drv' failed with exit code 1
error: build of '/nix/store/qxxl4jd1q2jpljl3b8ilz4spzhp0zp7c-cabal2nix-my_script.drv' failed
[root@nixos:/home/zeta/example_projects/simple_examples/my_script]#
@zeta-00
Copy link
Author

zeta-00 commented Dec 11, 2019

[zeta@nixos:/my_script]$ ls
CHANGELOG.md Setup.hs my-script.cabal
Main.hs default.nix my_script.hs
[zeta@nixos:/my_script]$ nix-shell
building '/nix/store/qxxl4jd1q2jpljl3b8ilz4spzhp0zp7c-cabal2nix-my_script.drv'...
installing
error: creating directory '/nix/var': Permission denied
error: creating directory '/nix/var': Permission denied
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
** need a revision for VCS when the hash is given. skipping.
cabal2nix: user error (Failed to fetch source. Does this source exist? Source {sourceUrl = "/nix/store/0c335601jszw1kwkghn7qanzlrv40mdi-my_script", sourceRevision = "", sourceHash = Guess "", sourceCabalDir = ""})
builder for '/nix/store/qxxl4jd1q2jpljl3b8ilz4spzhp0zp7c-cabal2nix-my_script.drv' failed with exit code 1
error: build of '/nix/store/qxxl4jd1q2jpljl3b8ilz4spzhp0zp7c-cabal2nix-my_script.drv' failed
[zeta@nixos:/my_script]$

@zeta-00
Copy link
Author

zeta-00 commented Dec 11, 2019

let
pkgs = import { };
in
pkgs.haskellPackages.developPackage
{
root = ./.;
modifier = drv:
pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
[
cabal-install
ghcid
]);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment