Skip to content

Commit a4f25f9

Browse files
committed
clean up flake for nix flake check
1 parent 83f21fa commit a4f25f9

File tree

4 files changed

+66
-67
lines changed

4 files changed

+66
-67
lines changed

.envrc

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
use flake

app/Main.hs

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ import System.IO
1313
import Command
1414
import Data.ByteString (ByteString)
1515

16+
-- TODO
17+
-- remove bag pages
18+
-- remove current cover
19+
-- option to put newfile in CWD or in same dir as input file
20+
1621
runCommand :: [String] -> IO
1722
( S.OutputStream ByteString
1823
, S.InputStream ByteString

flake.nix

+60-65
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,71 @@
11
{
2-
inputs.nixpkgs.url = "github:nixos/nixpkgs/23.11";
3-
inputs.flake-utils.url = "github:numtide/flake-utils";
2+
inputs = {
3+
nixpkgs.url = "github:nixos/nixpkgs/23.11";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
46

57
outputs = { nixpkgs, self, flake-utils }:
6-
flake-utils.lib.eachDefaultSystem (system:
7-
let
8-
compiler = "ghc948";
9-
hPkgs = pkgs.haskell.packages."${compiler}";
10-
devTools = with pkgs; [
11-
asciinema
12-
asciinema-agg
13-
cabal2nix
14-
imagemagick
15-
zlib
16-
];
8+
# flake-utils.lib.eachDefaultSystem (system:
9+
let
10+
compiler = "ghc948";
11+
system = flake-utils.lib.system.x86_64-linux;
12+
hPkgs = pkgs.haskell.packages."${compiler}";
13+
devTools = with pkgs; [
14+
asciinema
15+
asciinema-agg
16+
cabal2nix
17+
imagemagick
18+
zlib
19+
];
1720

18-
haskDevTools = with hPkgs; [
19-
ghc
20-
ghcid
21-
fourmolu
22-
hlint
23-
haskell-language-server
24-
implicit-hie
25-
retrie
26-
cabal-install
27-
];
21+
haskDevTools = with hPkgs; [
22+
ghc
23+
ghcid
24+
fourmolu
25+
hlint
26+
haskell-language-server
27+
implicit-hie
28+
retrie
29+
cabal-install
30+
];
2831

29-
tools = devTools ++ haskDevTools;
32+
tools = devTools ++ haskDevTools;
3033

31-
pkgs = import nixpkgs {
32-
inherit system;
33-
config = { allowUnfree = true; };
34-
};
35-
36-
pdftc = pkgs.callPackage ./packages/pdftc.nix { };
37-
awscost = pkgs.callPackage ./packages/awscost.nix { };
38-
booknote = pkgs.callPackage ./packages/booknote.nix { inherit pdftc; };
39-
epubthumb = pkgs.callPackage ./packages/epubthumb.nix { };
40-
mdtopdf = pkgs.callPackage ./packages/mdtopdf.nix { };
41-
roamamer = pkgs.callPackage ./packages/roamamer.nix { };
42-
seder = pkgs.callPackage ./packages/seder.nix { };
43-
transcribe = pkgs.callPackage ./packages/transcribe.nix { };
34+
pkgs = import nixpkgs {
35+
inherit system;
36+
overlays = [ self.overlays.all ];
37+
};
4438

45-
mkApp = p:
46-
let name = pkgs.lib.getName p;
47-
in {
48-
type = "app";
49-
program = "${p}/bin/${name}";
50-
};
51-
newcover2 = with pkgs; haskell.packages.${compiler}.callPackage ./. { };
39+
in {
40+
devShells.${system}.default = pkgs.mkShell {
41+
buildInputs = tools;
42+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath tools;
43+
};
5244

53-
in {
54-
apps = {
55-
awscost = mkApp awscost;
56-
booknote = mkApp booknote;
57-
epubthumb = mkApp epubthumb;
58-
mdtopdf = mkApp mdtopdf;
59-
pdftc = mkApp pdftc;
60-
roamamer = mkApp roamamer;
61-
seder = mkApp seder;
62-
transcribe = mkApp transcribe;
63-
};
64-
65-
devShells.default = pkgs.mkShell {
66-
buildInputs = tools;
67-
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath tools;
68-
};
45+
packages.${system} = with pkgs; {
46+
inherit awscost;
47+
inherit booknote;
48+
inherit epubthumb;
49+
inherit mdtopdf;
50+
inherit newcover;
51+
inherit pdftc;
52+
inherit roamamer;
53+
inherit seder;
54+
inherit transcribe;
55+
};
6956

70-
packages = {
71-
default = newcover2;
72-
inherit pdftc;
57+
overlays = {
58+
all = final: prev: {
59+
awscost = prev.callPackage ./packages/awscost.nix { };
60+
booknote = prev.callPackage ./packages/booknote.nix { };
61+
epubthumb = prev.callPackage ./packages/epubthumb.nix { };
62+
mdtopdf = prev.callPackage ./packages/mdtopdf.nix { };
63+
newcover = prev.haskell.packages.${compiler}.callPackage ./. { };
64+
pdftc = prev.callPackage ./packages/pdftc.nix { };
65+
roamamer = prev.callPackage ./packages/roamamer.nix { };
66+
seder = prev.callPackage ./packages/seder.nix { };
67+
transcribe = prev.callPackage ./packages/transcribe.nix { };
7368
};
74-
overlays = import ./overlay.nix;
75-
});
69+
};
70+
};
7671
}

overlay.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
final: prev: rec {
2-
pdftc = prev.callPackage ./packages/pdftc.nix { };
32
awscost = prev.callPackage ./packages/awscost.nix { };
43
booknote = prev.callPackage ./packages/booknote.nix { inherit pdftc; };
54
epubthumb = prev.callPackage ./packages/epubthumb.nix { };
65
mdtopdf = prev.callPackage ./packages/mdtopdf.nix { };
6+
pdftc = prev.callPackage ./packages/pdftc.nix { };
77
roamamer = prev.callPackage ./packages/roamamer.nix { };
88
seder = prev.callPackage ./packages/seder.nix { };
99
transcribe = prev.callPackage ./packages/transcribe.nix { };

0 commit comments

Comments
 (0)