Add LICENSE
This commit is contained in:
53
overlay.nix
Normal file
53
overlay.nix
Normal file
@@ -0,0 +1,53 @@
|
||||
final: prev: {
|
||||
rustPlatform = prev.rustPlatform // {
|
||||
buildDioxusWebApp = prev.lib.extendMkDerivation {
|
||||
constructDrv = prev.rustPlatform.buildRustPackage;
|
||||
extendDrvArgs =
|
||||
finalAttrs:
|
||||
args@{
|
||||
src,
|
||||
nativeBuildInputs ? [ ],
|
||||
...
|
||||
}:
|
||||
let
|
||||
pkg-info = (prev.lib.trivial.importTOML "${src}/Cargo.toml").package;
|
||||
pname = pkg-info.name;
|
||||
in
|
||||
{
|
||||
pname = pkg-info.name;
|
||||
version = pkg-info.version;
|
||||
|
||||
GIT_REV = if builtins.hasAttr "rev" src then src.rev else src.dirtyRev;
|
||||
|
||||
cargoLock.lockFile = "${src}/Cargo.lock";
|
||||
|
||||
nativeBuildInputs = with prev; [
|
||||
makeWrapper
|
||||
dioxus-cli
|
||||
]
|
||||
++ nativeBuildInputs;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
dx build --release --frozen --web
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
install -t "$out" target/dx/${pname}/release/web/server
|
||||
|
||||
cp -r target/dx/${pname}/release/web/public "$out/public"
|
||||
|
||||
makeWrapper "$out/server" "$out/bin/${pname}" \
|
||||
--set DIOXUS_PUBLIC_PATH "$out/public"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
// args;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user