-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (71 loc) · 2.05 KB
/
flake.nix
File metadata and controls
77 lines (71 loc) · 2.05 KB
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
70
71
72
73
74
75
76
77
{
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
imports = [
inputs.treefmt-nix.flakeModule
];
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 ];
};
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 ];
};
};
treefmt = {
projectRootFile = "flake.lock";
programs = {
deadnix.enable = true;
nixfmt.enable = true;
shfmt.enable = true;
statix.enable = true;
clang-format.enable = true;
cmake-format.enable = true;
};
settings.formatter.cmake-format.excludes = [ "pkg-config.pc.cmake" ];
};
};
flake = {
overlays.default = import ./overlay.nix;
};
};
}