Skip to content

Commit eaa81b3

Browse files
authored
Merge pull request cachix#3 from hercules-ci/cabal-fmt
Get cabal-fmt to work
2 parents 877ef72 + 0441189 commit eaa81b3

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

nix/default.nix

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
{ sources ? import ./sources.nix }:
2+
23
with {
34
overlay =
45
_: pkgs:
5-
{
6+
let
7+
haskell = import sources."haskell.nix" { inherit pkgs; };
8+
pkgPlan =
9+
haskell.callCabalProjectToNix {
10+
index-state = "2019-08-18T00:00:00Z";
11+
src = sources.cabal-fmt;
12+
};
13+
# Instantiate a package set using the generated file.
14+
pkgSet =
15+
haskell.mkCabalProjectPkgSet {
16+
plan-pkgs = import pkgPlan;
17+
pkg-def-extras = [];
18+
modules = [];
19+
};
20+
in {
621
inherit (import sources.niv {}) niv;
7-
inherit (import sources.ormolu { }) ormolu;
22+
inherit (import sources.ormolu {}) ormolu;
823
inherit (import sources.canonix {}) canonix;
9-
cabal-fmt = null;
24+
cabal-fmt =
25+
pkgSet.config.hsPkgs.cabal-fmt.components.exes.cabal-fmt;
1026
packages = pkgs.callPackages ./packages.nix {};
1127
};
1228
};

nix/run.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let
2222
- id: cabal-fmt
2323
name: cabal-fmt
2424
description: Format Cabal files
25-
entry: cabal-fmt --inplace
25+
entry: ${tools.cabal-fmt}/bin/cabal-fmt --inplace
2626
language: system
2727
files: '\.cabal$'
2828
- id: canonix

nix/sources.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@
2323
"url": "https://github.com/hercules-ci/canonix/archive/2600422b204b5795fc1f8992d253fedca4d10ea8.tar.gz",
2424
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
2525
},
26+
"haskell.nix": {
27+
"branch": "master",
28+
"description": "Alternative Haskell Infrastructure for Nixpkgs",
29+
"homepage": "https://input-output-hk.github.io/haskell.nix",
30+
"owner": "input-output-hk",
31+
"repo": "haskell.nix",
32+
"rev": "2c161d73b51f4c26adb95bd58a63e6e463bcba1c",
33+
"sha256": "18apq45lfnn1sgsccn0vi0dnq29zzzvi3naakd8xzdsfn0xp61g9",
34+
"type": "tarball",
35+
"url": "https://github.com/input-output-hk/haskell.nix/archive/2c161d73b51f4c26adb95bd58a63e6e463bcba1c.tar.gz",
36+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
37+
},
2638
"niv": {
2739
"branch": "master",
2840
"description": "Easy dependency management for Nix projects",
@@ -35,14 +47,15 @@
3547
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3648
},
3749
"nixpkgs": {
38-
"branch": "nixos-18.09",
50+
"branch": "nixos-19.03",
3951
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
4052
"homepage": "https://github.com/NixOS/nixpkgs",
4153
"owner": "NixOS",
4254
"repo": "nixpkgs-channels",
43-
"rev": "a7e559a5504572008567383c3dc8e142fa7a8633",
44-
"sha256": "16j95q58kkc69lfgpjkj76gw5sx8rcxwi3civm0mlfaxxyw9gzp6",
45-
"url": "https://github.com/NixOS/nixpkgs-channels/archive/a7e559a5504572008567383c3dc8e142fa7a8633.tar.gz",
55+
"rev": "67135fbcc5d5d28390c127ef519b09a362ef2466",
56+
"sha256": "00591607zmn1hfjs4959ksh164b0gjqwkvbrc4anx6da8xmhfcc2",
57+
"type": "tarball",
58+
"url": "https://github.com/NixOS/nixpkgs-channels/archive/67135fbcc5d5d28390c127ef519b09a362ef2466.tar.gz",
4659
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
4760
},
4861
"ormolu": {

0 commit comments

Comments
 (0)