about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ni/nix-web/package.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-19 17:14:52 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-19 17:14:52 +0100
commitf4d4283e3992c3f559831b1c030cd1fda6d45f98 (patch)
treec2cc63060849298d9a8e7a329010bb0fc4abb219 /nixpkgs/pkgs/by-name/ni/nix-web/package.nix
parentdac53cd746c10feddd48d4a1981235a653d7d32a (diff)
parent0ace63bed8f561e4cc5b1c8fa5fee6be61fbcf8b (diff)
downloadnixlib-f4d4283e3992c3f559831b1c030cd1fda6d45f98.tar
nixlib-f4d4283e3992c3f559831b1c030cd1fda6d45f98.tar.gz
nixlib-f4d4283e3992c3f559831b1c030cd1fda6d45f98.tar.bz2
nixlib-f4d4283e3992c3f559831b1c030cd1fda6d45f98.tar.lz
nixlib-f4d4283e3992c3f559831b1c030cd1fda6d45f98.tar.xz
nixlib-f4d4283e3992c3f559831b1c030cd1fda6d45f98.tar.zst
nixlib-f4d4283e3992c3f559831b1c030cd1fda6d45f98.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs into HEAD
Diffstat (limited to 'nixpkgs/pkgs/by-name/ni/nix-web/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/ni/nix-web/package.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/ni/nix-web/package.nix b/nixpkgs/pkgs/by-name/ni/nix-web/package.nix
new file mode 100644
index 000000000000..e41e760a2939
--- /dev/null
+++ b/nixpkgs/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";
+  };
+}