-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
71 lines (58 loc) · 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
description = "vicky";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/staging-next";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }: {
overlays.default = final: prev: {
vicky = final.callPackage (
{ lib, stdenv, rustPlatform, pkg-config, openssl, protobuf, postgresql, jless }:
rustPlatform.buildRustPackage {
pname = "vicky";
version =
self.shortRev or "dirty-${toString self.lastModifiedDate}";
src = self;
cargoBuildFlags = lib.optionals (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isStatic) [ "--features" "mimalloc" ];
cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};
nativeBuildInputs = [ pkg-config protobuf ];
buildInputs = [ openssl postgresql jless ];
}
) { };
vicky-dashboard = final.callPackage (
{ lib, stdenv, buildNpmPackage}:
buildNpmPackage {
pname = "vicky-dashboard";
version =
self.shortRev or "dirty-${toString self.lastModifiedDate}";
src = ./dashboard;
npmDepsHash = "sha256-n+dgMhdPZ8LgpDhOdnybDDYHWKZoFopVUb7acK15cd0=";
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r dist/* $out
runHook postInstall
'';
}
) { };
};
} // flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in {
packages = {
inherit (pkgs) vicky vicky-dashboard;
default = pkgs.vicky;
};
legacyPackages = pkgs;
devShells.default = pkgs.mkShell {
name = "vicky-shell";
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
nativeBuildInputs = with pkgs; [ rustc clippy cargo rustfmt pkg-config protobuf ];
buildInputs = with pkgs; [ openssl postgresql ];
};
});
}