-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
51 lines (46 loc) · 1.25 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
{
inputs.nixpkgs.url = "nixpkgs/release-23.11";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.crane = {
url = "github:ipetkov/crane/v0.15.1";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
flake-utils,
crane,
...
}: let
mkLamina = import ./nix/lamina.nix;
outputs = flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {inherit system;};
craneLib = crane.lib.${system};
callPackage = pkgs.lib.callPackageWith (pkgs // {inherit crane;});
lamina = callPackage mkLamina {};
in {
checks = builtins.removeAttrs lamina.checks ["cargo-nextest"];
packages.default = lamina;
devShells.default = craneLib.devShell {
checks = self.checks.${system};
packages = [
pkgs.rust-analyzer
pkgs.cargo-outdated
];
};
}
);
in
outputs
// {
overlays.default = final: prev: {
lamina = outputs.packages.${final.system}.default;
};
overlays.withHostPkgs = final: prev: let
callPackage = final.lib.callPackageWith (final // {inherit crane;});
in {
lamina = callPackage mkLamina {};
};
};
}