mirror of
https://github.com/ilyakooo0/ormolu.git
synced 2024-09-19 04:37:08 +03:00
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.
This commit is contained in:
parent
c13a515b28
commit
6b73283246
@ -31,7 +31,7 @@ jobs:
|
|||||||
command: nix-build
|
command: nix-build
|
||||||
- run:
|
- run:
|
||||||
name: Generate Haddocks
|
name: Generate Haddocks
|
||||||
command: nix-build --attr doc
|
command: nix-build --attr ormolu.doc
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: result-doc/share/doc
|
path: result-doc/share/doc
|
||||||
destination: haddock
|
destination: haddock
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,3 +26,4 @@ cabal.sandbox.config
|
|||||||
dist-*/
|
dist-*/
|
||||||
dist/
|
dist/
|
||||||
stack.yaml
|
stack.yaml
|
||||||
|
result*
|
||||||
|
35
default.nix
35
default.nix
@ -1,24 +1,19 @@
|
|||||||
let pkgs = import ./nix/nixpkgs;
|
let
|
||||||
|
pkgs = import ./nix/nixpkgs;
|
||||||
|
gitignoreSource = import ./nix/gitignore { inherit (pkgs) lib; };
|
||||||
compiler = "ghc864";
|
compiler = "ghc864";
|
||||||
sourceRegex = [
|
source = gitignoreSource ./.;
|
||||||
"^app.*$"
|
haskellPackages = pkgs.haskell.packages.${compiler}.override {
|
||||||
"^data.*$"
|
overrides = (self: super:
|
||||||
"^ormolu.cabal$"
|
super // {
|
||||||
"^src.*$"
|
"ormolu" = super.callCabal2nix "ormolu" source { };
|
||||||
"^tests.*$"
|
|
||||||
"^.*\.md$"
|
|
||||||
];
|
|
||||||
haskellPackages = pkgs.haskell.packages.${compiler}.override
|
|
||||||
{ overrides = (self: super:
|
|
||||||
super //
|
|
||||||
{ "ormolu" = super.callCabal2nix "ormolu" (pkgs.lib.sourceByRegex ./. sourceRegex) {};
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
in if pkgs.lib.inNixShell
|
in {
|
||||||
then haskellPackages.shellFor
|
ormolu = haskellPackages.ormolu;
|
||||||
{ packages = (ps: [ ps.ormolu ]);
|
ormolu-shell = haskellPackages.shellFor {
|
||||||
buildInputs = [
|
packages = ps: [ ps.ormolu ];
|
||||||
pkgs.cabal-install
|
buildInputs = [ pkgs.cabal-install ];
|
||||||
];
|
};
|
||||||
}
|
}
|
||||||
else haskellPackages.ormolu
|
|
||||||
|
8
nix/gitignore/default.nix
Normal file
8
nix/gitignore/default.nix
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{ lib }:
|
||||||
|
|
||||||
|
let
|
||||||
|
rev = "ec5dd0536a5e4c3a99c797b86180f7261197c124";
|
||||||
|
sha256 = "0k2r8y21rn4kr5dmddd3906x0733fs3bb8hzfpabkdav3wcy3klv";
|
||||||
|
url = "https://github.com/hercules-ci/gitignore/archive/${rev}.tar.gz";
|
||||||
|
nixGitIgnore = builtins.fetchTarball { inherit url sha256; };
|
||||||
|
in (import nixGitIgnore { inherit lib; }).gitignoreSource
|
@ -1,8 +1,10 @@
|
|||||||
let
|
let
|
||||||
rev = "f52505fac8c82716872a616c501ad9eff188f97f";
|
rev = "454eea84a757ca5f733c4ec0f234eba2281c74eb";
|
||||||
sha256 = "0q2m2qhyga9yq29yz90ywgjbn9hdahs7i8wwlq7b55rdbyiwa5dy";
|
sha256 = "1k9jbix4w43brqlfmvwy218pf5fbmzsnc08shaww9qfdl1rdlaxy";
|
||||||
pkgs = import (builtins.fetchTarball {
|
nixpkgs = builtins.fetchTarball {
|
||||||
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
}) { config.allowUnfree = true; };
|
};
|
||||||
|
pkgs = import nixpkgs { config.allowUnfree = true; };
|
||||||
in pkgs
|
in pkgs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user