Skip to content

Commit 40cc083

Browse files
committed
Updating nix files to allow nix-build directly
1 parent 0af9232 commit 40cc083

File tree

3 files changed

+31
-30
lines changed

3 files changed

+31
-30
lines changed

default.nix

+1-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +1 @@
1-
let
2-
sources = import ./nix/sources.nix;
3-
pkgs = import sources.nixpkgs { inherit config; };
4-
hls = import sources.all-hls { version = "0.9.0"; ghc = "8.8.4"; };
5-
6-
compilerVersion = "ghc884";
7-
compilerSet = pkgs.haskell.packages."${compilerVersion}";
8-
9-
gitIgnore = pkgs.nix-gitignore.gitignoreSourcePure;
10-
config = {
11-
packageOverrides = super: let self = super.pkgs; in rec {
12-
haskell = super.haskell // {
13-
packageOverrides = self: super: {
14-
turing-machines = super.callCabal2nix "turing-machines" (gitIgnore [./.gitignore] ./.) {};
15-
};
16-
};
17-
};
18-
};
19-
in {
20-
inherit pkgs;
21-
shell = compilerSet.shellFor {
22-
packages = p: [p.turing-machines];
23-
buildInputs = with pkgs; [
24-
compilerSet.cabal-install
25-
ormolu
26-
hls
27-
];
28-
};
29-
}
1+
(import ./project.nix).pkgs.haskellPackages.turing-machines

project.nix

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
let
2+
sources = import ./nix/sources.nix;
3+
pkgs = import sources.nixpkgs { inherit config; };
4+
hls = import sources.all-hls { version = "0.9.0"; ghc = "8.8.4"; };
5+
6+
compilerVersion = "ghc884";
7+
compilerSet = pkgs.haskell.packages."${compilerVersion}";
8+
9+
gitIgnore = pkgs.nix-gitignore.gitignoreSourcePure;
10+
config = {
11+
packageOverrides = super: let self = super.pkgs; in rec {
12+
haskell = super.haskell // {
13+
packageOverrides = self: super: {
14+
turing-machines = super.callCabal2nix "turing-machines" (gitIgnore [./.gitignore] ./.) {};
15+
};
16+
};
17+
};
18+
};
19+
in {
20+
inherit pkgs;
21+
shell = compilerSet.shellFor {
22+
packages = p: [p.turing-machines];
23+
buildInputs = with pkgs; [
24+
compilerSet.cabal-install
25+
ormolu
26+
hls
27+
];
28+
};
29+
}

shell.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(import ./default.nix).shell
1+
(import ./project.nix).shell

0 commit comments

Comments
 (0)