Files
nixpkgs/pkgs/by-name/ti/tiny-rdm/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

113 lines
2.7 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
fetchNpmDeps,
npmHooks,
nodejs,
wails,
webkitgtk_4_1,
pkg-config,
copyDesktopItems,
makeDesktopItem,
autoPatchelfHook,
writeScript,
}:
buildGoModule (finalAttrs: {
pname = "tiny-rdm";
version = "1.2.5";
src = fetchFromGitHub {
owner = "tiny-craft";
repo = "tiny-rdm";
tag = "v${finalAttrs.version}";
hash = "sha256-LzZsnO14cyYzmEas23Mrf0I+ZZa7y4ZfLg/gPBLcNc8=";
};
postPatch = ''
substituteInPlace frontend/src/App.vue \
--replace-fail "prefStore.autoCheckUpdate" "false"
'';
vendorHash = "sha256-dv+1yRl0UUo6lkLjfYAgRDR8pMfuh4lM6JapIXNQG9Q=";
env = {
CGO_ENABLED = 1;
npmDeps = fetchNpmDeps {
src = "${finalAttrs.src}/frontend";
hash = "sha256-0QMakUr2QBDYb/BRMALOACsfknrzimgaNkdFMjg73og=";
};
npmRoot = "frontend";
};
nativeBuildInputs = [
wails
pkg-config
autoPatchelfHook
nodejs
npmHooks.npmConfigHook
copyDesktopItems
];
buildInputs = [ webkitgtk_4_1 ];
buildPhase = ''
runHook preBuild
wails build -m -trimpath -devtools -tags webkit2_41 -o tiny-rdm
runHook postBuild
'';
desktopItems = [
(makeDesktopItem {
name = "tiny-rdm";
exec = "tiny-rdm %U";
icon = "tiny-rdm";
type = "Application";
terminal = false;
desktopName = "Tiny RDM";
startupWMClass = "tinyrdm";
categories = [ "Office" ];
mimeTypes = [ "x-scheme-handler/tinyrdm" ];
comment = "Tiny Redis Desktop Manager";
})
];
installPhase = ''
runHook preInstall
install -Dm 0755 build/bin/tiny-rdm $out/bin/tiny-rdm
install -Dm 0644 frontend/src/assets/images/icon.png $out/share/pixmaps/tiny-rdm.png
runHook postInstall
'';
passthru = {
inherit (finalAttrs.env) npmDeps;
updateScript = writeScript "update-tiny-rdm" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash nix nix-update common-updater-scripts
set -eou pipefail
version=$(nix eval --log-format raw --raw --file default.nix tiny-rdm.version)
nix-update tiny-rdm || true
latestVersion=$(nix eval --log-format raw --raw --file default.nix tiny-rdm.version)
if [[ "$latestVersion" == "$version" ]]; then
exit 0
fi
update-source-version tiny-rdm "$latestVersion" --source-key=npmDeps --ignore-same-version
nix-update tiny-rdm --version skip
'';
};
meta = {
description = "Modern, colorful, super lightweight Redis GUI client";
homepage = "https://github.com/tiny-craft/tiny-rdm";
mainProgram = "tiny-rdm";
license = with lib.licenses; [ gpl3Plus ];
maintainers = [ ];
platforms = lib.platforms.linux;
};
})