about summary refs log tree commit diff
path: root/pkgs/by-name/ni
diff options
context:
space:
mode:
authorRyan Lahfa <masterancpp@gmail.com>2023-11-18 00:16:45 +0100
committerGitHub <noreply@github.com>2023-11-18 00:16:45 +0100
commit3e818245ffcfa54b51c628993fefc06666770233 (patch)
treee8346f6708adda617a48b81e289f9bd7159c6619 /pkgs/by-name/ni
parent717e8f90878a2d0a623af778604335fe2b3dd519 (diff)
parent910346346995055bfbb1d8d4b99787baec0ef408 (diff)
downloadnixlib-3e818245ffcfa54b51c628993fefc06666770233.tar
nixlib-3e818245ffcfa54b51c628993fefc06666770233.tar.gz
nixlib-3e818245ffcfa54b51c628993fefc06666770233.tar.bz2
nixlib-3e818245ffcfa54b51c628993fefc06666770233.tar.lz
nixlib-3e818245ffcfa54b51c628993fefc06666770233.tar.xz
nixlib-3e818245ffcfa54b51c628993fefc06666770233.tar.zst
nixlib-3e818245ffcfa54b51c628993fefc06666770233.zip
Merge pull request #267674 from liclac/nix-web-init
Diffstat (limited to 'pkgs/by-name/ni')
-rw-r--r--pkgs/by-name/ni/nix-web/package.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/by-name/ni/nix-web/package.nix b/pkgs/by-name/ni/nix-web/package.nix
new file mode 100644
index 000000000000..e41e760a2939
--- /dev/null
+++ b/pkgs/by-name/ni/nix-web/package.nix
@@ -0,0 +1,48 @@
+{ lib
+, rustPlatform
+, fetchFromGitea
+, pkg-config
+, openssl
+, nix
+}:
+
+let
+  cargoFlags = [ "-p" "nix-web" ];
+in
+rustPlatform.buildRustPackage rec {
+  pname = "nix-web";
+  version = "0.1.0";
+
+  src = fetchFromGitea {
+    domain = "codeberg.org";
+    owner = "gorgon";
+    repo = "gorgon";
+    rev = "nix-web-v${version}";
+    hash = "sha256-+IDvoMRuMt1nS69yFhPPVs+s6Dj0dgXVdjjd9f3+spk=";
+  };
+  cargoHash = "sha256-uVBfIw++MRxgVAC+KzGVuMZra8oktUfHcZQk90FF1a8=";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ openssl ];
+
+  postPatch = ''
+    substituteInPlace nix-web/nix-web.service \
+      --replace 'ExecStart=nix-web' "ExecStart=$out/bin/nix-web"
+  '';
+  postInstall = ''
+    install -m 644 -D nix-web/nix-web.service $out/lib/systemd/system/nix-web.service
+  '';
+
+  cargoBuildFlags = cargoFlags;
+  cargoTestFlags = cargoFlags;
+
+  NIX_WEB_BUILD_NIX_CLI_PATH = "${nix}/bin/nix";
+
+  meta = with lib; {
+    description = "Web interface for the Nix store";
+    homepage = "https://codeberg.org/gorgon/gorgon/src/branch/main/nix-web";
+    license = licenses.eupl12;
+    maintainers = with maintainers; [ embr ];
+    mainProgram = "nix-web";
+  };
+}