tlaternet-webserver/nix/packages.nix

58 lines
1.3 KiB
Nix

{
self,
nixpkgs,
dream2nix,
fenix,
system,
...
}: let
inherit (nixpkgs.legacyPackages.${system}) runCommandLocal yj;
rust-toolchain = fenix.packages.${system}.stable;
in
dream2nix.lib.makeFlakeOutputs {
systems = [system];
config.projectRoot = self;
projects = ../projects.toml;
source = runCommandLocal "source" {nativeBuildInputs = [yj];} ''
cp -r ${self} $out/
chmod -R u+w $out
yj < $out/templates/package.yaml > $out/templates/package.json
'';
packageOverrides = {
tlaternet-webserver.set-toolchain.overrideRustToolchain = old: {
cargo = rust-toolchain.minimalToolchain;
rustc = rust-toolchain.minimalToolchain;
};
tlaternet-webserver-deps.set-toolchain.overrideRustToolchain = old: {
cargo = rust-toolchain.minimalToolchain;
rustc = rust-toolchain.minimalToolchain;
};
tlaternet = {
install-only-dist = {
installPhase = ''
cp -r $nodeModules/tlaternet/dist $out
'';
};
};
sharp = {
add-libvips = {
buildInputs = old:
old
++ (with nixpkgs.legacyPackages.${system}; [
vips
pkg-config
]);
};
};
};
}
// {
inherit rust-toolchain;
}