nixpkgs/pkgs/by-name/ss/sshuttle/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

62 lines
1.5 KiB
Nix

{ lib
, stdenv
, python3Packages
, fetchFromGitHub
, installShellFiles
, makeWrapper
, sphinx
, coreutils
, iptables
, nettools
, openssh
, procps
}:
python3Packages.buildPythonApplication rec {
pname = "sshuttle";
version = "1.1.2";
src = fetchFromGitHub {
owner = "sshuttle";
repo = "sshuttle";
rev = "v${version}";
hash = "sha256-7jiDTjtL4FiQ4GimSPtUDKPUA29l22a7XILN/s4/DQY=";
};
patches = [ ./sudo.patch ];
nativeBuildInputs = [
installShellFiles
makeWrapper
python3Packages.setuptools-scm
sphinx
];
nativeCheckInputs = with python3Packages; [ pytest-cov-stub pytestCheckHook ];
postBuild = ''
make man -C docs
'';
postInstall = ''
installManPage docs/_build/man/*
wrapProgram $out/bin/sshuttle \
--prefix PATH : "${lib.makeBinPath ([ coreutils openssh procps ] ++ lib.optionals stdenv.hostPlatform.isLinux [ iptables nettools ])}" \
'';
meta = with lib; {
description = "Transparent proxy server that works as a poor man's VPN";
mainProgram = "sshuttle";
longDescription = ''
Forward connections over SSH, without requiring administrator access to the
target network (though it does require Python 2.7, Python 3.5 or later at both ends).
Works with Linux and Mac OS and supports DNS tunneling.
'';
homepage = "https://github.com/sshuttle/sshuttle";
changelog = "https://github.com/sshuttle/sshuttle/blob/v${version}/CHANGES.rst";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ domenkozar carlosdagos ];
};
}