-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
53 lines (46 loc) · 1.63 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
description = "Easy Invoice Maker";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
config = {
packageOverrides = pkgs: rec {
haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: rec {
easy-invoice-maker =
haskellPackagesNew.callPackage ./easy-invoice-maker.nix {};
mustache =
haskellPackagesNew.callPackage ./nix/mustache.nix {};
};
};
};
permittedInsecurePackages = [ "qtwebkit-5.212.0-alpha4" ];
};
pkgs = import nixpkgs {
inherit system;
inherit config;
};
addRuntimeDependency = drv: dep: addRuntimeDependencies drv [ dep ];
addRuntimeDependencies = drv: deps: pkgs.haskell.lib.overrideCabal drv (drv: {
buildDepends = (drv.buildDepends or []) ++ [ pkgs.makeWrapper ];
postInstall = ''
${drv.postInstall or ""}
for exe in "$out/bin/"* ; do
wrapProgram "$exe" --prefix PATH ":" \
${pkgs.lib.makeBinPath deps}
done
'';
});
in {
# nix build .#easy-invoice-maker
packages.easy-invoice-maker =
addRuntimeDependency pkgs.haskellPackages.easy-invoice-maker pkgs.wkhtmltopdf;
# nix build
defaultPackage = self.packages.${system}.easy-invoice-maker;
}
);
}