-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathflake.nix
53 lines (48 loc) · 1.59 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 = "Evaluate and build in parallel";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } (
{ lib, ... }:
let
officialPlatforms = [
"aarch64-linux"
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in
{
imports = [ ./treefmt.nix ];
systems = officialPlatforms ++ [ "riscv64-linux" ];
perSystem =
{ pkgs, self', ... }:
{
packages.nix-fast-build = pkgs.callPackage ./default.nix {
# we don't want to compile ghc otherwise
nix-output-monitor =
if lib.elem pkgs.hostPlatform.system officialPlatforms then pkgs.nix-output-monitor else null;
};
legacyPackages = {
hello-broken = pkgs.hello.overrideAttrs (_old: {
meta.broken = true;
});
};
packages.default = self'.packages.nix-fast-build;
checks =
let
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
in
packages // devShells;
};
}
);
}