-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
41 lines (39 loc) · 1.3 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
{
description = "hledger-locker";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
ghc = "ghc966";
pkgs = nixpkgs.legacyPackages.${system};
packageName = "hledger-locker";
haskellPackages = pkgs.haskell.packages.${ghc}.extend (hself: hsuper: {
hledger-locker = hself.callCabal2nix packageName self { };
});
in
{
packages.${packageName} =
(haskellPackages.callCabal2nix packageName self { }).overrideAttrs(finalAttrs: previousAttrs : {
buildPhase = ''
export HLOCKER_BUILD_TIME_GIT_REV=${builtins.substring 0 7 (
if self ? rev then self.rev else ""
)}
'' + previousAttrs.buildPhase;
});
packages.default = self.packages.${system}.${packageName};
devShells.default = haskellPackages.shellFor {
nativeBuildInputs = [
haskellPackages.stan
haskellPackages.stylish-haskell
haskellPackages.cabal-install
haskellPackages.weeder
];
inputsFrom = builtins.attrValues self.packages.${system};
packages = p: [ p.hledger-locker ];
};
});
}