lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
690 stars 72 forks source link

Add build instructions for nix #213

Closed bsima closed 5 years ago

bsima commented 5 years ago

This works on my NixOS machine, and it should work everywhere else too, since i've pinned the nixpkgs version in pkgs.nix. The default.nix file supports both nix build and nix-shell automatically. You can also do e.g. nix-shell --argstr compiler ghc844 to change the compiler; I have it set to ghc822 as the default because that's what worked for me when building.

ElvishJerricco commented 5 years ago

Note that the use of developPackage means that this Nix file cannot be imported by any other project that intends to use nix-shell.

bsima commented 5 years ago

Will Fancher notifications@github.com writes:

Note that the use of developPackage means that this Nix file cannot be imported by any other project that intends to use nix-shell.

Good point Will. Commit e67a46f2649ee53380f2a7d933588e8587ba0ecd is an attempt to address this.

ElvishJerricco commented 5 years ago

@bsima How does that address this? release.nix still uses callPackage ./shell.nix, and shell.nix uses developPackage.

bsima commented 5 years ago

Will Fancher notifications@github.com writes:

@bsima How does that address this? release.nix still uses callPackage ./shell.nix, and shell.nix uses developPackage.

Users can import ./default.nix to get a nix expression without developPackage

lspitzner commented 5 years ago

I am gonna optimistically assume that the complain has indeed been resolved. Have not tested, but if there are issues we can always change things again later.

Thanks for the PR.