default.nix: use filterSource, copy more assets
This commit is contained in:
parent
ee9c1731e9
commit
8846312578
37
default.nix
37
default.nix
|
@ -2,21 +2,40 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cargoSha256 = "11hvxh8drqpimax7b5z5r8qiwzy00j5r0xdshml0wgzxnmrnxzqc";
|
src = builtins.filterSource (path: type:
|
||||||
|
!builtins.elem (baseNameOf path) [
|
||||||
build = pname: pkgs.rustPlatform.buildRustPackage {
|
"target"
|
||||||
inherit pname;
|
"default.nix"
|
||||||
|
"shell.nix"
|
||||||
|
"nixos-module.nix"
|
||||||
|
]
|
||||||
|
) ./.;
|
||||||
|
build = { pname, cargoSha256 }: pkgs.rustPlatform.buildRustPackage {
|
||||||
|
inherit pname cargoSha256 src;
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
src = ./.;
|
nativeBuildInputs = with pkgs; [ pkg-config ];
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
pkg-config openssl
|
openssl
|
||||||
postgresql.lib
|
postgresql.lib
|
||||||
];
|
];
|
||||||
preBuild = "pushd ${pname}";
|
preBuild = "pushd ${pname}";
|
||||||
postBuild = "popd";
|
postBuild = "popd";
|
||||||
inherit cargoSha256;
|
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
ticker-update = build "ticker-update";
|
ticker-update = build {
|
||||||
ticker-serve = build "ticker-serve";
|
pname = "ticker-update";
|
||||||
|
cargoSha256 = "12bc1nyy7pajzcv5997hx7z48dkpdx1hncfkn5dg607wly8bmqcw";
|
||||||
|
};
|
||||||
|
ticker-serve = (build {
|
||||||
|
pname = "ticker-serve";
|
||||||
|
cargoSha256 = "0xkvn6a9f4ary2w57vq30lx1d73cbmfgk34594hfybrk67m194zr";
|
||||||
|
}).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/
|
||||||
|
'';
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue