ticker/default.nix

42 lines
1.0 KiB
Nix

{ pkgs ? import <nixpkgs> {},
}:
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
];
preBuild = "pushd ${pname}";
postBuild = "popd";
};
in {
ticker-update = build {
pname = "ticker-update";
cargoSha256 = "11xygn7dqqyaw5h2g1pb7759f8n9fcyxljw36hhbgim4hz5pn8b2";
};
ticker-serve = (build {
pname = "ticker-serve";
cargoSha256 = "11mxm9fsbd5j5vlp0v96symqfrl2h38i2wh62azcpwdrfln55bql";
}).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/
'';
});
}