forked from helsinki-systems/harmonia
-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathflake.nix
68 lines (64 loc) · 2.19 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";
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
imports = [ inputs.treefmt-nix.flakeModule ];
perSystem =
{
lib,
config,
pkgs,
self',
...
}:
{
packages.harmonia = pkgs.callPackage ./. { };
packages.default = config.packages.harmonia;
checks =
let
testArgs = {
inherit pkgs;
inherit (inputs) self;
};
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
in
lib.optionalAttrs pkgs.stdenv.isLinux {
t00-simple = import ./tests/t00-simple.nix testArgs;
t01-signing = import ./tests/t01-signing.nix testArgs;
t02-varnish = import ./tests/t02-varnish.nix testArgs;
t03-chroot = import ./tests/t03-chroot.nix testArgs;
t04-tls = import ./tests/t04-tls.nix testArgs;
}
// {
clippy = config.packages.harmonia.override { enableClippy = true; };
}
// packages
// devShells;
devShells.default = pkgs.callPackage ./shell.nix { };
treefmt = {
# Used to find the project root
projectRootFile = "flake.lock";
programs.rustfmt.enable = true;
programs.nixfmt.enable = true;
programs.deadnix.enable = true;
programs.clang-format.enable = true;
};
};
flake.nixosModules.harmonia = ./module.nix;
};
}