Skip to content

Commit

Permalink
fix(services): Fix package
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Feb 27, 2024
1 parent 65ad395 commit 397317d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
4 changes: 1 addition & 3 deletions modules/services/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ in {
options.modules.services.ssh = {enable = mkBoolOpt false;};

config = mkIf cfg.enable {
user.packages = with pkgs; [sshuttle];

services.openssh = {
enable = true;
settings.KbdInteractiveAuthentication = false;
Expand All @@ -27,7 +25,7 @@ in {
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK3EVc3A55QHe83NXfqrClVohWz2DscDgx0pr4PSlcGO edmund.a.miller@protonmail.com"
];

environment.shellAliases.utd = "sshuttle --dns -r pubssh 10.0.0.0/8 129.110.0.0/16";
environment.shellAliases.utd = "${pkgs.my.sshuttle}/bin/sshuttle --dns -r pubssh 10.0.0.0/8 129.110.0.0/16";

programs.ssh.extraConfig = ''
Host *
Expand Down
26 changes: 20 additions & 6 deletions packages/sshuttle.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{ lib
, python3
, fetchFromGitHub
{
lib,
python3,
fetchFromGitHub,
fetchpatch,
}:

python3.pkgs.buildPythonApplication rec {
pname = "sshuttle";
version = "1.1.2";
Expand All @@ -15,6 +16,19 @@ python3.pkgs.buildPythonApplication rec {
hash = "sha256-7jiDTjtL4FiQ4GimSPtUDKPUA29l22a7XILN/s4/DQY=";
};

patches = [
(fetchpatch
{
url = "https://github.com/NixOS/nixpkgs/raw/nixos-unstable/pkgs/tools/security/sshuttle/sudo.patch";
hash = "sha256-wPHnnbP3YhYtnspJm/AfroSFtRm/VcsDNGkNXPrRHzU=";
})
];

postPatch = ''
substituteInPlace setup.cfg \
--replace '--cov=sshuttle --cov-branch --cov-report=term-missing' ""
'';

nativeBuildInputs = [
python3.pkgs.poetry-core
];
Expand All @@ -24,14 +38,14 @@ python3.pkgs.buildPythonApplication rec {
sphinx
];

pythonImportsCheck = [ "sshuttle" ];
pythonImportsCheck = ["sshuttle"];

meta = with lib; {
description = "Transparent proxy server that works as a poor man's VPN. Forwards over ssh. Doesn't require admin. Works with Linux and MacOS. Supports DNS tunneling";
homepage = "https://github.com/sshuttle/sshuttle";
changelog = "https://github.com/sshuttle/sshuttle/blob/${src.rev}/CHANGES.rst";
license = licenses.lgpl21Only;
maintainers = with maintainers; [ ];
maintainers = with maintainers; [];
mainProgram = "sshuttle";
};
}

0 comments on commit 397317d

Please sign in to comment.