Skip to content

Commit d1ae420

Browse files
committed
Avoid flake inputs using fetchGit
1 parent be69b37 commit d1ae420

File tree

5 files changed

+19
-39
lines changed

5 files changed

+19
-39
lines changed

flake.lock

Lines changed: 0 additions & 26 deletions
This file was deleted.

flake.nix

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
description = "A `flake-parts` module for Haskell development";
3-
inputs.nix-parsec.url = "github:kanwren/nix-parsec";
4-
outputs = { self, nix-parsec, ... }: {
5-
flakeModule = import ./nix/flake-module.nix { inherit nix-parsec; };
3+
outputs = { self, ... }: {
4+
flakeModule = ./nix/flake-module.nix;
65
templates.default = {
76
description = "A simple flake.nix using haskell-flake";
87
path = builtins.path { path = ./example; filter = path: _: baseNameOf path == "flake.nix"; };

nix/find-cabal-paths.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{ pkgs, lib, parsec, ... }:
1+
{ pkgs, lib, ... }:
22

33
let
4-
parser = import ./parser.nix { inherit pkgs lib parsec; };
4+
parser = import ./parser.nix { inherit pkgs lib; };
55
traversal = rec {
66
findSingleCabalFile = path:
77
let

nix/flake-module.nix

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{ nix-parsec }:
2-
31
# A flake-parts module for Haskell cabal projects.
42
{ self, config, lib, flake-parts-lib, withSystem, ... }:
53

@@ -15,7 +13,6 @@ let
1513
raw;
1614
in
1715
{
18-
_file = __curPos.file;
1916
options = {
2017
perSystem = mkPerSystemOption
2118
({ config, self', inputs', pkgs, system, ... }:
@@ -199,16 +196,17 @@ in
199196
packages = mkOption {
200197
type = types.lazyAttrsOf packageSubmodule;
201198
description = ''
202-
Attrset of local packages in the project repository.
199+
Set of local packages in the project repository.
203200
204-
Autodiscovered by default by looking for `.cabal` files in
205-
top-level or sub-directories.
201+
If you have a `cabal.project` file (under `projectRoot`),
202+
those packages are automatically discovered. Otherwise, a
203+
top-level .cabal or package.yaml file is used to discover
204+
the single local project.
206205
'';
207206
default =
208207
let
209208
find-cabal-paths = import ./find-cabal-paths.nix {
210209
inherit pkgs lib;
211-
inherit (nix-parsec.lib) parsec;
212210
};
213211
in
214212
lib.mapAttrs

nix/parser.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
{ pkgs, lib, parsec, ... }:
1+
{ pkgs, lib, ... }:
22

3+
let
4+
nix-parsec = builtins.fetchGit {
5+
url = "https://github.com/kanwren/nix-parsec.git";
6+
ref = "master";
7+
rev = "1bf25dd9c5de1257a1c67de3c81c96d05e8beb5e";
8+
shallow = true;
9+
};
10+
inherit (import nix-parsec) parsec;
11+
in
312
{
413
# Extract the "packages" list from a cabal.project file.
514
parseCabalProjectPackages = cabalProjectFile:

0 commit comments

Comments
 (0)