From 101feafed4b83e42b44a93b0386b025dede12545 Mon Sep 17 00:00:00 2001
From: Snorre Ettrup Altschul <snorre@altschul.dk>
Date: Thu, 6 Feb 2025 15:42:30 +0100
Subject: [PATCH] added comments

---
 flake.nix | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/flake.nix b/flake.nix
index c7728a5..a86976b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -41,15 +41,18 @@
       src = ./src/..;
       runtime = ./public;
 
+      # Cargo cant download dependencies at build time, so this downloads them through nix
       cargoDeps = pkgs.rustPlatform.importCargoLock {
         lockFile = "${src}/Cargo.lock";
       };
 
+      # we need rust to compile
       nativeBuildInputs = [
         pkgs.makeWrapper
         pkgs.rust-bin.nightly.latest.default
       ];
 
+      # build the thing
       buildPhase = ''
         runHook preBuild
         cargo build -r
@@ -58,15 +61,16 @@
         runHook postBuild
       '';
 
+      # move the files
       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
       '';
       
       meta = {
         description = "Website server backend";
         license = pkgs.lib.licenses.mit;
-        mainProgram = "webbisitey-wrapped";
+        mainProgram = "webbisitey-wrapped"; # we want to run the wrapped version
       };
     };
   };