on master help sign in
Clean nix configuration

* Point to more recent nixpkgs commit. This fixes build issue with python 3.7.3 (only on darwin?). * Separate shell.nix and default.nix. This is so that lorri can be used for development. * Add nix output to .gitignore. * Format *.nix using nixfmt. * Use gitignore for filtering files in nix derivation.

commit6b7328324634aa80158618a177e8fa6ffac9d844 authorLuc Tielen <luc.tielen@kabisa.nl> dateWed 19 Jun 2019, 22:48 (7 years ago) parentc13a515
6 files changed+36−29
.circleci/config.yml+1−1 .gitignore+1 default.nix+19−24 nix/gitignore/default.nix+8 nix/nixpkgs/default.nix+6−4 shell.nix+1
.circleci/config.yml+1−1
@@ -31,7 +31,7 @@ jobs:
3131 command: nix-build
3232 - run:
3333 name: Generate Haddocks
34− command: nix-build --attr doc
34+ command: nix-build --attr ormolu.doc
3535 - store_artifacts:
3636 path: result-doc/share/doc
3737 destination: haddock
.gitignore+1
@@ -26,3 +26,4 @@ cabal.sandbox.config
2626dist-*/
2727dist/
2828stack.yaml
29+result*
default.nix+19−24
@@ -1,24 +1,19 @@
1−let pkgs = import ./nix/nixpkgs;
2− compiler = "ghc864";
3− sourceRegex = [
4− "^app.*$"
5− "^data.*$"
6− "^ormolu.cabal$"
7− "^src.*$"
8− "^tests.*$"
9− "^.*\.md$"
10− ];
11− haskellPackages = pkgs.haskell.packages.${compiler}.override
12− { overrides = (self: super:
13− super //
14− { "ormolu" = super.callCabal2nix "ormolu" (pkgs.lib.sourceByRegex ./. sourceRegex) {};
15− });
16− };
17−in if pkgs.lib.inNixShell
18− then haskellPackages.shellFor
19− { packages = (ps: [ ps.ormolu ]);
20− buildInputs = [
21− pkgs.cabal-install
22− ];
23− }
24− else haskellPackages.ormolu
1+let
2+ pkgs = import ./nix/nixpkgs;
3+ gitignoreSource = import ./nix/gitignore { inherit (pkgs) lib; };
4+ compiler = "ghc864";
5+ source = gitignoreSource ./.;
6+ haskellPackages = pkgs.haskell.packages.${compiler}.override {
7+ overrides = (self: super:
8+ super // {
9+ "ormolu" = super.callCabal2nix "ormolu" source { };
10+ });
11+ };
12+in {
13+ ormolu = haskellPackages.ormolu;
14+ ormolu-shell = haskellPackages.shellFor {
15+ packages = ps: [ ps.ormolu ];
16+ buildInputs = [ pkgs.cabal-install ];
17+ };
18+}
19+
nix/gitignore/default.nixnew file+8
@@ -0,0 +1,8 @@
1+{ lib }:
2+
3+let
4+ rev = "ec5dd0536a5e4c3a99c797b86180f7261197c124";
5+ sha256 = "0k2r8y21rn4kr5dmddd3906x0733fs3bb8hzfpabkdav3wcy3klv";
6+ url = "https://github.com/hercules-ci/gitignore/archive/${rev}.tar.gz";
7+ nixGitIgnore = builtins.fetchTarball { inherit url sha256; };
8+in (import nixGitIgnore { inherit lib; }).gitignoreSource
nix/nixpkgs/default.nix+6−4
@@ -1,8 +1,10 @@
11let
2− rev = "f52505fac8c82716872a616c501ad9eff188f97f";
3− sha256 = "0q2m2qhyga9yq29yz90ywgjbn9hdahs7i8wwlq7b55rdbyiwa5dy";
4− pkgs = import (builtins.fetchTarball {
2+ rev = "454eea84a757ca5f733c4ec0f234eba2281c74eb";
3+ sha256 = "1k9jbix4w43brqlfmvwy218pf5fbmzsnc08shaww9qfdl1rdlaxy";
4+ nixpkgs = builtins.fetchTarball {
55 url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
66 inherit sha256;
7− }) { config.allowUnfree = true; };
7+ };
8+ pkgs = import nixpkgs { config.allowUnfree = true; };
89in pkgs
10+
shell.nixnew file+1
@@ -0,0 +1 @@
1+(import ./default.nix).ormolu-shell