2021-02-13 14:23:35 +00:00
|
|
|
{ lib
|
2022-07-18 16:21:45 +00:00
|
|
|
, buildGoModule
|
2021-02-13 14:23:35 +00:00
|
|
|
, fetchFromGitHub
|
2022-03-05 16:20:37 +00:00
|
|
|
, installShellFiles
|
2022-05-18 14:49:53 +00:00
|
|
|
, nixosTests
|
2022-03-05 16:20:37 +00:00
|
|
|
}:
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
buildGoModule rec {
|
2021-02-13 14:23:35 +00:00
|
|
|
pname = "upterm";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "0.9.0";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "owenthereal";
|
|
|
|
repo = "upterm";
|
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
hash = "sha256-ywwqX4aw9vc2kptYZisArTpdz7Cf49Z0jMdP90KXejs=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
subPackages = [ "cmd/upterm" "cmd/uptermd" ];
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
# force go to build for build arch rather than host arch during cross-compiling
|
|
|
|
CGO_ENABLED=0 GOOS= GOARCH= go run cmd/gendoc/main.go
|
2021-02-13 14:23:35 +00:00
|
|
|
installManPage etc/man/man*/*
|
|
|
|
installShellCompletion --bash --name upterm.bash etc/completion/upterm.bash_completion.sh
|
|
|
|
installShellCompletion --zsh --name _upterm etc/completion/upterm.zsh_completion
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) uptermd; };
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Secure terminal-session sharing";
|
|
|
|
homepage = "https://upterm.dev";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ hax404 ];
|
|
|
|
};
|
|
|
|
}
|