-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
61 lines (53 loc) · 1.67 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
54
55
56
57
58
59
60
61
{
inputs = { nixpkgs.url = "nixpkgs"; };
description = "resume for jonathan strickland";
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = f:
nixpkgs.lib.genAttrs supportedSystems (system: f system);
in {
# dev shell just provides ghc 9.2
devShells = forAllSystems (system:
let pkgs = import nixpkgs { inherit system; };
in {
resume = pkgs.mkShell {
buildInputs = with pkgs; [
haskell.compiler.ghc902
zlib.dev
];
};
});
# the package definition pulls in haskell deps through nixpkgs
packages = forAllSystems (system:
let pkgs = import nixpkgs { inherit system; };
in {
resume = pkgs.stdenv.mkDerivation {
name = "resume";
version = "0.1.0";
src = ./.;
buildInputs = with pkgs.haskell; [
(packages.ghc902.ghcWithPackages (haskellPackages:
with haskellPackages; [
blaze-html
blaze-markup
typed-process
bytestring
text
dhall
]))
pkgs.wkhtmltopdf
];
buildPhase = ''
export RESUME_NIXPKGS_REV="${nixpkgs.rev}"
# move config into src for runhaskell
cp -rv icons style.css experience.dhall src/
cd src && runhaskell Main.hs
'';
installPhase = ''
mkdir -p $out && install -Dm755 resume.pdf $out/resume.pdf
'';
};
});
};
}