about summary refs log tree commit diff
path: root/pkgs/servers/gotify/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/gotify/default.nix')
-rw-r--r--pkgs/servers/gotify/default.nix24
1 files changed, 15 insertions, 9 deletions
diff --git a/pkgs/servers/gotify/default.nix b/pkgs/servers/gotify/default.nix
index 6a33f2a400945..b940f35e6a577 100644
--- a/pkgs/servers/gotify/default.nix
+++ b/pkgs/servers/gotify/default.nix
@@ -5,19 +5,18 @@
 , sqlite
 , callPackage
 , nixosTests
+, nix-update-script
 }:
 
 buildGoModule rec {
   pname = "gotify-server";
-  # should be update just like all other files imported like that via the
-  # `update.sh` script.
-  version = import ./version.nix;
+  version = "2.3.0";
 
   src = fetchFromGitHub {
     owner = "gotify";
     repo = "server";
     rev = "v${version}";
-    sha256 = import ./source-sha.nix;
+    hash = "sha256-fWcdnmpLZycg7hmPNnphGcuSMTI4bsq57XPoSyQSGDA=";
   };
 
   # With `allowGoReference = true;`, `buildGoModule` adds the `-trimpath`
@@ -26,20 +25,28 @@ buildGoModule rec {
   #   server[780]: stat /var/lib/private/ui/build/index.html: no such file or directory
   allowGoReference = true;
 
-  vendorSha256 = import ./vendor-sha.nix;
+  vendorHash = "sha256-im7Pauit0tWi0BcyKtxybOqsu7rrIHZwY5Olta3nJJI=";
 
   doCheck = false;
 
-  buildInputs = [ sqlite ];
+  buildInputs = [
+    sqlite
+  ];
 
   ui = callPackage ./ui.nix { };
 
   preBuild = ''
-    cp -r ${ui}/libexec/gotify-ui/deps/gotify-ui/build ui/build && go run hack/packr/packr.go
+    if [ -n "$ui" ] # to make the preBuild a no-op inside the goModules fixed-output derivation, where it would fail
+    then
+      cp -r $ui ui/build
+    fi
   '';
 
   passthru = {
-    updateScript = ./update.sh;
+    # For nix-update to detect the location of this attribute from this
+    # derivation.
+    inherit (ui) offlineCache;
+    updateScript = nix-update-script { };
     tests = {
       nixos = nixosTests.gotify-server;
     };
@@ -60,5 +67,4 @@ buildGoModule rec {
     maintainers = with maintainers; [ doronbehar ];
     mainProgram = "server";
   };
-
 }