-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathflake.nix
More file actions
59 lines (54 loc) · 1.48 KB
/
Copy pathflake.nix
File metadata and controls
59 lines (54 loc) · 1.48 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
# SPDX-License-Identifier: Unlicense
{
inputs = {
# nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# systems.url = "github:nix-systems/default";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
treefmt-nix,
...
}@inputs:
let
eachSystem =
f:
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
system: f system nixpkgs.legacyPackages.${system}
);
treefmtEval = eachSystem (_system: pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in
{
packages = eachSystem (
_system: pkgs: {
# default = pkgs.hello;
}
);
devShells = eachSystem (
_system: pkgs: {
default = pkgs.mkShell (
with pkgs;
{
buildInputs = [
# Add development dependencies here
];
}
);
}
);
# Run `nix fmt [FILE_OR_DIR]...` to execute formatters configured in treefmt.nix.
formatter = eachSystem (system: _pkgs: treefmtEval.${system}.config.build.wrapper);
checks = eachSystem (
system: _pkgs: {
# Throws an error if any of the source files are not correctly formatted
# when you run `nix flake check --print-build-logs`. Useful for CI
treefmt = treefmtEval.${system}.config.build.check self;
}
);
};
}