-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathflake.nix
46 lines (40 loc) · 1.2 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
{
description = "A utility for sharing a Nix store as a binary cache";
inputs.nixpkgs.url = "nixpkgs/nixos-24.05";
outputs = { self, nixpkgs }:
let
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
systems = [
"x86_64-linux"
"aarch64-linux"
"i686-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in {
overlays.default = final: prev: {
nix-serve = final.pkgs.callPackage ./package.nix {
inherit self;
nix = final.nixVersions.git;
};
};
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
default = nix-serve;
nix-serve = nixpkgs.legacyPackages.${system}.callPackage ./package.nix {
inherit self;
nix = pkgs.nixVersions.git;
};
});
checks = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
build = self.packages.${system}.nix-serve;
} // nixpkgs.lib.optionalAttrs (pkgs.stdenv.isLinux) {
nixos-test = pkgs.callPackage ./nixos-test.nix {
nix-serve = self.packages.${system}.nix-serve;
};
});
};
}