hswaw/laserproxy: fix nix build

This bitrot at some point. Now it's all freshened up.

Change-Id: Ia7df1ccd9b39d9180131452e9bf18d0fb8fa50d5
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1163
Reviewed-by: informatic <informatic@hackerspace.pl>
diff --git a/hswaw/laserproxy/default.nix b/hswaw/laserproxy/default.nix
index 5b235ef..f048ef4 100644
--- a/hswaw/laserproxy/default.nix
+++ b/hswaw/laserproxy/default.nix
@@ -15,7 +15,6 @@
     git python3 postgresql go
   ];
   patches = [
-    ./nix-disable-uwsgi.patch
     ./nix-use-system-go.patch
     ./nix-disable-workspace-status.patch
   ];
@@ -23,19 +22,29 @@
   removeRulesCC = false;
   fetchConfigured = true;
   fetchAttrs = {
-    inherit patches;
-    # Nicked from nixpkgs usages of buildBazelPackage.
+    # Nicked from nixpkgs'  usages of buildBazelPackage in bazel_watcher.
     preInstall = ''
+      # Remove the go_sdk (it's just a copy of the go derivation) and all
+      # references to it from the marker files. Bazel does not need to download
+      # this sdk because we have patched the WORKSPACE file to point to the one
+      # currently present in PATH. Without removing the go_sdk from the marker
+      # file, the hash of it will change anytime the Go derivation changes and
+      # that would lead to impurities in the marker files which would result in
+      # a different sha256 for the fetch phase.
       rm -rf $bazelOut/external/{go_sdk,\@go_sdk.marker}
       sed -e '/^FILE:@go_sdk.*/d' -i $bazelOut/external/\@*.marker
-    
+      
+      # Retains go build input markers
       chmod -R 755 $bazelOut/external/{bazel_gazelle_go_repository_cache,@\bazel_gazelle_go_repository_cache.marker}
       rm -rf $bazelOut/external/{bazel_gazelle_go_repository_cache,@\bazel_gazelle_go_repository_cache.marker}
-    
+      
+      # Remove the gazelle tools, they contain go binaries that are built
+      # non-deterministically. As long as the gazelle version matches the tools
+      # should be equivalent.
       rm -rf $bazelOut/external/{bazel_gazelle_go_repository_tools,\@bazel_gazelle_go_repository_tools.marker}
       sed -e '/^FILE:@bazel_gazelle_go_repository_tools.*/d' -i $bazelOut/external/\@*.marker
     '';
-    sha256 = "0d0vlls1i0nmlqiszfhwb0cn1kwll3ffxd3sn30pk7drhfrbvqhf";
+    sha256 = "178ai44v8lczzy9gyqnkqmcnjvmw8m89qzaqv6my5fqkw6psliqz";
   };
   buildAttrs = {
     inherit patches;