-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
37 lines (31 loc) · 1.02 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
{
description = "sparsesrv";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
outputs = { self, nixpkgs }:
let
systems =
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
# Memoize nixpkgs for different platforms for efficiency.
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
});
in {
overlays.default = final: prev: {
sparsesrv = final.callPackage ({ rustPlatform }:
rustPlatform.buildRustPackage {
pname = "sparsesrv";
version = "0.1.0";
src = self;
cargoLock = {
lockFile = ./Cargo.lock;
};
}) { };
};
packages =
forAllSystems (system: { inherit (nixpkgsFor.${system}) sparsesrv; });
defaultPackage = forAllSystems (system: self.packages.${system}.sparsesrv);
};
}