on master help sign in
add flake.nix
962b3ceAbhishek Singh
flake.locknew file+97
@@ -0,0 +1,97 @@
1+{
2+ "nodes": {
3+ "flake-parts": {
4+ "inputs": {
5+ "nixpkgs-lib": "nixpkgs-lib"
6+ },
7+ "locked": {
8+ "lastModified": 1678379998,
9+ "narHash": "sha256-TZdfNqftHhDuIFwBcN9MUThx5sQXCTeZk9je5byPKRw=",
10+ "owner": "hercules-ci",
11+ "repo": "flake-parts",
12+ "rev": "c13d60b89adea3dc20704c045ec4d50dd964d447",
13+ "type": "github"
14+ },
15+ "original": {
16+ "owner": "hercules-ci",
17+ "repo": "flake-parts",
18+ "type": "github"
19+ }
20+ },
21+ "gitignore": {
22+ "inputs": {
23+ "nixpkgs": "nixpkgs"
24+ },
25+ "locked": {
26+ "lastModified": 1660459072,
27+ "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
28+ "owner": "hercules-ci",
29+ "repo": "gitignore.nix",
30+ "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
31+ "type": "github"
32+ },
33+ "original": {
34+ "owner": "hercules-ci",
35+ "repo": "gitignore.nix",
36+ "type": "github"
37+ }
38+ },
39+ "nixpkgs": {
40+ "locked": {
41+ "lastModified": 1632846328,
42+ "narHash": "sha256-sFi6YtlGK30TBB9o6CW7LG9mYHkgtKeWbSLAjjrNTX0=",
43+ "owner": "NixOS",
44+ "repo": "nixpkgs",
45+ "rev": "2b71ddd869ad592510553d09fe89c9709fa26b2b",
46+ "type": "github"
47+ },
48+ "original": {
49+ "id": "nixpkgs",
50+ "type": "indirect"
51+ }
52+ },
53+ "nixpkgs-lib": {
54+ "locked": {
55+ "dir": "lib",
56+ "lastModified": 1678375444,
57+ "narHash": "sha256-XIgHfGvjFvZQ8hrkfocanCDxMefc/77rXeHvYdzBMc8=",
58+ "owner": "NixOS",
59+ "repo": "nixpkgs",
60+ "rev": "130fa0baaa2b93ec45523fdcde942f6844ee9f6e",
61+ "type": "github"
62+ },
63+ "original": {
64+ "dir": "lib",
65+ "owner": "NixOS",
66+ "ref": "nixos-unstable",
67+ "repo": "nixpkgs",
68+ "type": "github"
69+ }
70+ },
71+ "nixpkgs_2": {
72+ "locked": {
73+ "lastModified": 1678500213,
74+ "narHash": "sha256-A5s2rXawJ+dCThkMXoMuYW8dgyUmkElcyfVJUot/Vr0=",
75+ "owner": "nixos",
76+ "repo": "nixpkgs",
77+ "rev": "2ce9b9842b5e63884dfc3dea6689769e2a1ea309",
78+ "type": "github"
79+ },
80+ "original": {
81+ "owner": "nixos",
82+ "ref": "nixpkgs-unstable",
83+ "repo": "nixpkgs",
84+ "type": "github"
85+ }
86+ },
87+ "root": {
88+ "inputs": {
89+ "flake-parts": "flake-parts",
90+ "gitignore": "gitignore",
91+ "nixpkgs": "nixpkgs_2"
92+ }
93+ }
94+ },
95+ "root": "root",
96+ "version": 7
97+}
flake.nixnew file+37
@@ -0,0 +1,37 @@
1+{
2+ inputs = {
3+ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
4+ flake-parts.url = "github:hercules-ci/flake-parts";
5+ gitignore.url = "github:hercules-ci/gitignore.nix";
6+ };
7+ outputs = inputs@{ nixpkgs, flake-parts, gitignore, ... }:
8+ flake-parts.lib.mkFlake { inherit inputs; } {
9+ systems = nixpkgs.lib.systems.flakeExposed;
10+ perSystem = { self', inputs', pkgs, system, ... }:
11+ let
12+ inherit (gitignore.lib) gitignoreSource;
13+ fixCyclicReference = drv:
14+ pkgs.haskell.lib.overrideCabal drv (_: {
15+ enableSeparateBinOutput = false;
16+ });
17+ overlay = self: super: {
18+ jrec = self.callCabal2nix "jrec" (gitignoreSource ./.) { };
19+ # Workaround for https://github.com/NixOS/nixpkgs/issues/140774
20+ haskell-language-server = super.haskell-language-server.overrideScope (lself: lsuper: {
21+ ormolu = fixCyclicReference super.ormolu;
22+ });
23+ };
24+ haskellPackages' = pkgs.haskellPackages.extend overlay;
25+ in
26+ {
27+ packages.default = haskellPackages'.jrec;
28+ devShells.default = haskellPackages'.shellFor {
29+ packages = p: [ p.jrec ];
30+ buildInputs = with haskellPackages'; [
31+ cabal-install
32+ haskell-language-server
33+ ];
34+ };
35+ };
36+ };
37+}
hie.yaml+16−5
@@ -1,6 +1,17 @@
1cradle:
1cradle:
2+ multi:
3+ - path: ./Setup.hs
4+ config:
5+ cradle:
6+ direct:
7+ arguments:
8+ - "-package Cabal"
9+ - "-package base"
10+ - path: ./
11+ config:
12+ cradle:
2− cabal:
13+ cabal:
3− - path: "./src"
14+ - path: "./src"
4− component: "lib:jrec"
15+ component: "lib:jrec"
5− - path: "./test"
16+ - path: "./test"
6− component: "test:jrec-test"
17+ component: "test:jrec-test"