summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorColin Arnott <colin@urandom.co.uk>2022-11-30 04:06:11 +0000
committerColin Arnott <colin@urandom.co.uk>2022-12-03 04:21:41 +0000
commit370593baf8cc557bb2126e8bead1a7ca5b40bd9e (patch)
tree2c5175979803968879a1811070ea618eee7ac8fc /pkgs/servers
parentfb9b50242dc8edbf358a3de25c7e060c456c4ba2 (diff)
downloadnixpkgs-370593baf8cc557bb2126e8bead1a7ca5b40bd9e.tar
nixpkgs-370593baf8cc557bb2126e8bead1a7ca5b40bd9e.tar.gz
nixpkgs-370593baf8cc557bb2126e8bead1a7ca5b40bd9e.tar.bz2
nixpkgs-370593baf8cc557bb2126e8bead1a7ca5b40bd9e.tar.lz
nixpkgs-370593baf8cc557bb2126e8bead1a7ca5b40bd9e.tar.xz
nixpkgs-370593baf8cc557bb2126e8bead1a7ca5b40bd9e.tar.zst
nixpkgs-370593baf8cc557bb2126e8bead1a7ca5b40bd9e.zip
olaris-server: init at 0.4.0
Fixes #114305
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/olaris/default.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/servers/olaris/default.nix b/pkgs/servers/olaris/default.nix
new file mode 100644
index 00000000000..2561fed1dc6
--- /dev/null
+++ b/pkgs/servers/olaris/default.nix
@@ -0,0 +1,53 @@
+{ buildGoModule, fetchFromGitLab, fetchzip, installShellFiles, lib }:
+
+buildGoModule rec {
+  pname = "olaris-server";
+  version = "0.4.0";
+
+  src = fetchFromGitLab {
+  owner = "olaris";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-iworyQqyTabTI0NpZHTdUBGZSCaiC5Dhr69mRtsHLOs=";
+  };
+
+  preBuild = let
+    olaris-react = fetchzip {
+      url = "https://gitlab.com/api/v4/projects/olaris%2Folaris-react/jobs/artifacts/v${version}/download?job=build";
+      extension = "zip";
+      hash = "sha256-MkxBf/mGvtiOu0e79bMpd9Z/D0eOxhzPE+bKic//viM=";
+    };
+  in ''
+    # cannot build olaris-react https://github.com/NixOS/nixpkgs/issues/203708
+    cp -r ${olaris-react} react/build
+    make generate
+  '';
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X gitlab.com/olaris/olaris-server/helpers.Version=${version}"
+  ];
+
+  vendorHash = "sha256-xWywDgw0LzJhPtVK0aGgT0TTanejJ39ZmGc50A3d68U=";
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  # integration tests require network access
+  doCheck = false;
+
+  postInstall = ''
+    installShellCompletion --cmd olaris-server \
+      --bash <($out/bin/olaris-server completion bash) \
+      --fish <($out/bin/olaris-server completion fish) \
+      --zsh <($out/bin/olaris-server completion zsh)
+  '';
+
+  meta = with lib; {
+    description = "A media manager and transcoding server.";
+    homepage = "https://gitlab.com/olaris/olaris-server";
+    changelog = "https://gitlab.com/olaris/olaris-server/-/releases/v${version}";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ urandom ];
+  };
+}