Merge pull request #267674 from liclac/nix-web-init

authored by

Ryan Lahfa and committed by
GitHub
3e818245 717e8f90

+48
+48
pkgs/by-name/ni/nix-web/package.nix
··· 1 + { lib 2 + , rustPlatform 3 + , fetchFromGitea 4 + , pkg-config 5 + , openssl 6 + , nix 7 + }: 8 + 9 + let 10 + cargoFlags = [ "-p" "nix-web" ]; 11 + in 12 + rustPlatform.buildRustPackage rec { 13 + pname = "nix-web"; 14 + version = "0.1.0"; 15 + 16 + src = fetchFromGitea { 17 + domain = "codeberg.org"; 18 + owner = "gorgon"; 19 + repo = "gorgon"; 20 + rev = "nix-web-v${version}"; 21 + hash = "sha256-+IDvoMRuMt1nS69yFhPPVs+s6Dj0dgXVdjjd9f3+spk="; 22 + }; 23 + cargoHash = "sha256-uVBfIw++MRxgVAC+KzGVuMZra8oktUfHcZQk90FF1a8="; 24 + 25 + nativeBuildInputs = [ pkg-config ]; 26 + buildInputs = [ openssl ]; 27 + 28 + postPatch = '' 29 + substituteInPlace nix-web/nix-web.service \ 30 + --replace 'ExecStart=nix-web' "ExecStart=$out/bin/nix-web" 31 + ''; 32 + postInstall = '' 33 + install -m 644 -D nix-web/nix-web.service $out/lib/systemd/system/nix-web.service 34 + ''; 35 + 36 + cargoBuildFlags = cargoFlags; 37 + cargoTestFlags = cargoFlags; 38 + 39 + NIX_WEB_BUILD_NIX_CLI_PATH = "${nix}/bin/nix"; 40 + 41 + meta = with lib; { 42 + description = "Web interface for the Nix store"; 43 + homepage = "https://codeberg.org/gorgon/gorgon/src/branch/main/nix-web"; 44 + license = licenses.eupl12; 45 + maintainers = with maintainers; [ embr ]; 46 + mainProgram = "nix-web"; 47 + }; 48 + }