Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 fetchNpmDeps, 6 npmHooks, 7 nodejs, 8 wails, 9 webkitgtk_4_0, 10 pkg-config, 11 libsoup_3, 12 copyDesktopItems, 13 makeDesktopItem, 14 autoPatchelfHook, 15 nix-update-script, 16}: 17 18buildGoModule (finalAttrs: { 19 pname = "tiny-rdm"; 20 version = "1.2.4"; 21 22 src = fetchFromGitHub { 23 owner = "tiny-craft"; 24 repo = "tiny-rdm"; 25 tag = "v${finalAttrs.version}"; 26 hash = "sha256-wSTC9Ne/Q9LLZL2+8ObMFCXrf4VSI0LkZhHHbAiXCYE="; 27 }; 28 29 postPatch = '' 30 substituteInPlace frontend/src/App.vue \ 31 --replace-fail "prefStore.autoCheckUpdate" "false" 32 ''; 33 34 vendorHash = "sha256-Hh/qudoCZtIHJLsI6GQ814W4nC/uRd4gQd0PobzMlnQ="; 35 36 env = { 37 CGO_ENABLED = 1; 38 npmDeps = fetchNpmDeps { 39 src = "${finalAttrs.src}/frontend"; 40 hash = "sha256-dcoTwfRocVjpBzqS9f2MkXjzcCI5sLjRZ3UC/Ml+7T0="; 41 }; 42 npmRoot = "frontend"; 43 }; 44 45 nativeBuildInputs = [ 46 wails 47 pkg-config 48 autoPatchelfHook 49 nodejs 50 npmHooks.npmConfigHook 51 copyDesktopItems 52 ]; 53 54 buildInputs = [ 55 webkitgtk_4_0 56 libsoup_3 57 ]; 58 59 buildPhase = '' 60 runHook preBuild 61 62 wails build -m -trimpath -devtools -tags webkit2_40 -o tiny-rdm 63 64 runHook postBuild 65 ''; 66 67 desktopItems = [ 68 (makeDesktopItem { 69 name = "tiny-rdm"; 70 exec = "tiny-rdm %U"; 71 icon = "tiny-rdm"; 72 type = "Application"; 73 terminal = false; 74 desktopName = "Tiny RDM"; 75 startupWMClass = "tinyrdm"; 76 categories = [ "Office" ]; 77 mimeTypes = [ "x-scheme-handler/tinyrdm" ]; 78 comment = "Tiny Redis Desktop Manager"; 79 }) 80 ]; 81 82 installPhase = '' 83 runHook preInstall 84 85 install -Dm 0755 build/bin/tiny-rdm $out/bin/tiny-rdm 86 install -Dm 0644 frontend/src/assets/images/icon.png $out/share/pixmaps/tiny-rdm.png 87 88 runHook postInstall 89 ''; 90 91 passthru.updateScript = nix-update-script { }; 92 93 meta = { 94 description = "Modern, colorful, super lightweight Redis GUI client"; 95 homepage = "https://github.com/tiny-craft/tiny-rdm"; 96 mainProgram = "tiny-rdm"; 97 license = with lib.licenses; [ gpl3Plus ]; 98 maintainers = with lib.maintainers; [ ]; 99 platforms = lib.platforms.linux; 100 }; 101})