This repository was archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
61 lines (56 loc) · 1.74 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
{
description = "Rust implementation of headless Silicon Heaven applications";
outputs = {
self,
flake-utils,
nixpkgs,
}:
with builtins;
with flake-utils.lib;
with nixpkgs.lib; let
packages = {
system,
pkgs ? nixpkgs.legacyPackages.${system},
}:
with pkgs; rec {
shvapp-rs = rustPlatform.buildRustPackage {
pname = "shvapp-rs";
version = head (
match ".*\nversion[ ]*=[ ]*\"([^\"]+)\"\n.*" (readFile ./Cargo.toml)
);
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"chainpack-0.1.0" = "sha256-hR0JD/oyk2Y8zS0rUcnKebsuHGJyvB6gfU6TmejAYBw=";
"shvlog-0.1.0" = "sha256-Trk8bAMhn2r75HDyrV2c/o8dLzzAJ/i2hsnSejewnjQ=";
};
};
doCheck = true;
meta = with lib; {
description = "Rust implementation of headless Silicon Heaven applications";
homepage = "https://github.com/silicon-heaven/shvapp-rs";
license = licenses.mit;
};
};
default = shvapp-rs;
};
in
{
overlays.default = final: prev:
packages {
system = prev.system;
pkgs = prev;
};
}
// eachDefaultSystem (system: {
packages = packages {inherit system;};
legacyPackages = import nixpkgs {
# The legacyPackages imported as overlay allows us to use pkgsCross
inherit system;
overlays = [self.overlays.default];
crossOverlays = [self.overlays.default];
};
formatter = nixpkgs.legacyPackages.${system}.alejandra;
});
}