-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
flake.nix
69 lines (63 loc) · 2.47 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
62
63
64
65
66
67
68
69
{
description = "Hydra's builtin hydra-eval-jobs as a standalone";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-github-actions.url = "github:nix-community/nix-github-actions";
inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
outputs =
inputs@{ flake-parts, ... }:
let
inherit (inputs.nixpkgs) lib;
inherit (inputs) self;
nixVersion = lib.fileContents ./.nix-version;
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
imports = [ inputs.treefmt-nix.flakeModule ];
flake.githubActions = inputs.nix-github-actions.lib.mkGithubMatrix {
platforms = {
"x86_64-linux" = [
"nscloud-ubuntu-22.04-amd64-4x16-with-cache"
"nscloud-cache-size-20gb"
"nscloud-cache-tag-nix-eval-jobs"
];
"x86_64-darwin" = "macos-13";
"aarch64-darwin" = "macos-latest";
"aarch64-linux" = [
"nscloud-ubuntu-22.04-arm64-4x16-with-cache"
"nscloud-cache-size-20gb"
"nscloud-cache-tag-nix-eval-jobs"
];
};
checks = {
inherit (self.checks) x86_64-linux aarch64-linux;
x86_64-darwin = builtins.removeAttrs self.checks.x86_64-darwin [ "treefmt" ];
};
};
perSystem =
{ pkgs, self', ... }:
let
drvArgs = {
srcDir = self;
nix =
if nixVersion == "latest" then pkgs.nixVersions.latest else pkgs.nixVersions."nix_${nixVersion}";
};
in
{
treefmt.imports = [ ./dev/treefmt.nix ];
packages.nix-eval-jobs = pkgs.callPackage ./default.nix drvArgs;
packages.clangStdenv-nix-eval-jobs = pkgs.callPackage ./default.nix (
drvArgs // { stdenv = pkgs.clangStdenv; }
);
packages.default = self'.packages.nix-eval-jobs;
devShells.default = pkgs.callPackage ./shell.nix drvArgs;
devShells.clang = pkgs.callPackage ./shell.nix (drvArgs // { stdenv = pkgs.clangStdenv; });
checks = builtins.removeAttrs self'.packages [ "default" ] // {
shell = self'.devShells.default;
};
};
};
}