forked from nix-community/harmonia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
68 lines (61 loc) · 1.91 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
{
description = "Nix binary cache implemented in rust using libnix-store";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
inputs.flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
nixConfig.extra-substituters = [
"https://cache.garnix.io"
];
nixConfig.extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
];
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = { lib, config, pkgs, ... }: {
packages.harmonia = pkgs.callPackage ./. { };
packages.default = config.packages.harmonia;
checks = (import ./tests/default.nix {
inherit pkgs;
inherit (inputs) self;
}) // {
clippy = config.packages.harmonia.override ({
enableClippy = true;
});
};
devShells.default = pkgs.callPackage ./shell.nix { };
treefmt = {
# Used to find the project root
projectRootFile = "flake.lock";
programs.rustfmt.enable = true;
settings.formatter = {
nix = {
command = "sh";
options = [
"-eucx"
''
export PATH=${lib.makeBinPath [ pkgs.coreutils pkgs.findutils pkgs.deadnix pkgs.nixpkgs-fmt ]}
deadnix --edit "$@"
nixpkgs-fmt "$@"
''
"--"
];
includes = [ "*.nix" ];
};
};
};
};
flake.nixosModules.harmonia = ./module.nix;
};
}