ticker/default.nix

42 lines
1.0 KiB
Nix
Raw Normal View History

{ pkgs ? import <nixpkgs> {},
2019-10-26 01:14:49 +02:00
}:
let
src = builtins.filterSource (path: type:
!builtins.elem (baseNameOf path) [
"target"
"default.nix"
"shell.nix"
"nixos-module.nix"
]
) ./.;
build = { pname, cargoSha256 }: pkgs.rustPlatform.buildRustPackage {
inherit pname cargoSha256 src;
version = "0.1.0";
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [
openssl
postgresql.lib
2019-10-26 01:20:04 +02:00
];
preBuild = "pushd ${pname}";
2019-10-26 01:20:04 +02:00
postBuild = "popd";
};
in {
ticker-update = build {
pname = "ticker-update";
2021-05-24 23:25:24 +02:00
cargoSha256 = "0limgs2lwx5vgi7x2wwwrk0z83xs4x59k56yy4ifwwz19h09knma";
};
ticker-serve = (build {
pname = "ticker-serve";
2021-05-24 23:25:24 +02:00
cargoSha256 = "116mhi8z9n5qmjkpzfslq4bjhgsjy1flag6lsp78v30pyghks8xx";
}).overrideAttrs (oa: {
postBuild = ''
${oa.postBuild}
mkdir -p $out/shared/libticker $out/shared/ticker-serve
cp -ar ticker-serve/static $out/shared/ticker-serve/
cp -ar schema.sql $out/shared/libticker/
'';
});
2019-10-07 00:33:44 +02:00
}