-
Notifications
You must be signed in to change notification settings - Fork 12
/
flake.nix
53 lines (51 loc) · 1.64 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
{
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
};
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
perSystem = { config, pkgs, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.self.overlays.default ];
};
packages = {
inherit (pkgs) pprintpp;
default = config.packages.pprintpp;
};
devShells.default = pkgs.mkShell {
inputsFrom = [ config.packages.default ];
inherit (config.checks.pre-commit-check) shellHook;
};
checks = {
clang-build = pkgs.pprintpp.override {
stdenv = pkgs.clangStdenv;
};
gcc-build = pkgs.pprintpp.override {
stdenv = pkgs.clangStdenv;
};
example-standalone = pkgs.stdenv.mkDerivation {
name = "pprintpp-example-project";
src = ./example;
buildInputs = [ config.packages.pprintpp ];
nativeBuildInputs = [ pkgs.cmake ];
};
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
clang-format.enable = true;
deadnix.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
};
};
};
};
flake = {
overlays.default = import ./overlay.nix;
};
};
}