added comments

This commit is contained in:
Snorre Ettrup Altschul 2025-02-06 15:42:30 +01:00
parent b075d0071b
commit 101feafed4

View file

@ -41,15 +41,18 @@
src = ./src/..; src = ./src/..;
runtime = ./public; runtime = ./public;
# Cargo cant download dependencies at build time, so this downloads them through nix
cargoDeps = pkgs.rustPlatform.importCargoLock { cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = "${src}/Cargo.lock"; lockFile = "${src}/Cargo.lock";
}; };
# we need rust to compile
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.makeWrapper pkgs.makeWrapper
pkgs.rust-bin.nightly.latest.default pkgs.rust-bin.nightly.latest.default
]; ];
# build the thing
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
cargo build -r cargo build -r
@ -58,15 +61,16 @@
runHook postBuild runHook postBuild
''; '';
# move the files
installPhase = '' installPhase = ''
makeWrapper $out/bin/webbisitey $out/bin/webbisitey-wrapped --run 'cd $(dirname $0)'; makeWrapper $out/bin/webbisitey $out/bin/webbisitey-wrapped --run 'cd $(dirname $0)'; # im too lazy to add a path argument so cd into the correct folder so it can serve files.
cp -r $runtime $out/bin/public cp -r $runtime $out/bin/public
''; '';
meta = { meta = {
description = "Website server backend"; description = "Website server backend";
license = pkgs.lib.licenses.mit; license = pkgs.lib.licenses.mit;
mainProgram = "webbisitey-wrapped"; mainProgram = "webbisitey-wrapped"; # we want to run the wrapped version
}; };
}; };
}; };