-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
88 lines (74 loc) · 2.42 KB
/
flake.nix
File metadata and controls
88 lines (74 loc) · 2.42 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
description = "vicky";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
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,
crates ? ["vicky"],
}:
rustPlatform.buildRustPackage {
pname = "vicky";
version =
self.shortRev or "dirty-${toString self.lastModifiedDate}";
src = self;
cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};
cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates;
cargoTestFlags = lib.concatMapStrings (c: "-p ${c} ") crates;
nativeBuildInputs = [ pkg-config protobuf ];
buildInputs = [ openssl postgresql jless ];
}
) { };
vickyctl = final.vicky.override { crates = [ "vickyctl" ]; };
fairy = final.vicky.override { crates = [ "fairy" ]; };
vicky-dashboard = final.callPackage (
{ lib, stdenv, buildNpmPackage, importNpmLock }:
buildNpmPackage {
pname = "vicky-dashboard";
version =
self.shortRev or "dirty-${toString self.lastModifiedDate}";
src = ./dashboard;
npmDeps = importNpmLock {
npmRoot = ./dashboard;
};
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r dist/* $out
runHook postInstall
'';
npmConfigHook = importNpmLock.npmConfigHook;
}
) { };
};
} // flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in {
packages = {
inherit (pkgs) vicky vickyctl vicky-dashboard fairy;
default = pkgs.vicky;
};
legacyPackages = pkgs;
devShells.default = pkgs.mkShell {
name = "vicky-shell";
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
DATABASE_URL = "postgres://vicky:vicky@localhost/vicky";
nativeBuildInputs = with pkgs; [ rustc clippy cargo rustfmt pkg-config protobuf devenv diesel-cli ];
buildInputs = with pkgs; [ openssl postgresql ];
};
});
}