-
Notifications
You must be signed in to change notification settings - Fork 755
/
flake.nix
50 lines (43 loc) · 1.36 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
{
inputs = { nixpkgs.url = "github:nixos/nixpkgs"; };
outputs = { self, nixpkgs }:
let
supportedSystems =
let
unsupportedSystems = [
# GHC not supported
"armv5tel-linux"
"armv6l-linux"
"powerpc64le-linux"
"riscv64-linux"
# "error: attribute 'busybox' missing" when building
# `bootstrap-tools`
"mipsel-linux"
];
in nixpkgs.lib.subtractLists unsupportedSystems nixpkgs.lib.systems.flakeExposed;
perSystem = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = system: import nixpkgs { inherit system; };
buildResumeFor = system:
let pkgs = pkgsFor system;
in pkgs.runCommand "build-resume" {
nativeBuildInputs = with pkgs; [ pandoc texlive.combined.scheme-context ];
} ''
cd ${self}
make OUT_DIR="$out"
'';
in {
packages = perSystem (system:
let
resume = buildResumeFor system;
in
{
inherit resume;
default = resume;
});
devShells = perSystem (system: {
default = import ./shell.nix { pkgs = pkgsFor system; };
});
devShell = perSystem (system: self.devShells.${system}.default);
defaultPackage = perSystem (system: self.packages.${system}.default);
};
}