From 8d0984def2c92bcab6c3027ab168b8ee6883bdf3 Mon Sep 17 00:00:00 2001 From: David Wronek Date: Tue, 24 Jun 2025 09:59:17 +0200 Subject: [PATCH] sshwifty: init at 0.4.0-beta-release Signed-off-by: David Wronek --- pkgs/by-name/ss/sshwifty/package.nix | 66 ++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 pkgs/by-name/ss/sshwifty/package.nix diff --git a/pkgs/by-name/ss/sshwifty/package.nix b/pkgs/by-name/ss/sshwifty/package.nix new file mode 100644 index 000000000000..fd9ac10b25f2 --- /dev/null +++ b/pkgs/by-name/ss/sshwifty/package.nix @@ -0,0 +1,66 @@ +{ + lib, + buildGo125Module, + buildNpmPackage, + fetchFromGitHub, + versionCheckHook, + nix-update-script, + go_1_25, +}: +buildGo125Module (finalAttrs: { + pname = "sshwifty"; + version = "0.4.0-beta-release"; + + src = fetchFromGitHub { + owner = "nirui"; + repo = "sshwifty"; + tag = finalAttrs.version; + hash = "sha256-7ZfS46+aflKIQ8S9T18JjCb7bY8mB6cJl/lgJi5Hukg="; + }; + + sshwifty-ui = buildNpmPackage { + pname = "sshwifty-ui"; + inherit (finalAttrs) version src; + + npmDepsHash = "sha256-I96VixL21cF2kp9AK6q0ipjphjdWuSETKakbsprGek0="; + + npmBuildScript = "generate"; + + postInstall = '' + cp -r application/controller/{static_pages,static_pages.go} \ + $out/lib/node_modules/sshwifty-ui/application/controller + ''; + + nativeBuildInputs = [ go_1_25 ]; + }; + + postPatch = '' + cp -r ${finalAttrs.sshwifty-ui}/lib/node_modules/sshwifty-ui/* . + ''; + + vendorHash = "sha256-kLKydjvZtFEY7vjqxK1cCwZSTbdqYWPRmxYSN0LYqsg="; + + ldflags = [ + "-s" + "-X github.com/nirui/sshwifty/application.version=${finalAttrs.version}" + ]; + + postInstall = '' + find $out/bin ! -name sshwifty -type f -exec rm -rf {} \; + ''; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "WebSSH & WebTelnet client"; + homepage = "https://github.com/nirui/sshwifty"; + changelog = "https://github.com/nirui/sshwifty/releases/tag/${finalAttrs.version}"; + license = lib.licenses.agpl3Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ ungeskriptet ]; + mainProgram = "sshwifty"; + }; +})