mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
571c71e6f7
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.
42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{ stdenv, lib, fetchFromGitHub, openssh, debugLevel ? 0 }:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "scponly";
|
|
version = "4.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "scponly";
|
|
repo = "scponly";
|
|
rev = "d8ca58257b9905186aa5706f35813d5f80ea07c1";
|
|
sha256 = "U0K7lOp18ytNjh3KVFmc6vL+/tG4ETnwLEPQEhM4lXE=";
|
|
};
|
|
|
|
patches = [ ./scponly-fix-make.patch ];
|
|
|
|
strictDeps = true;
|
|
|
|
# chroot doesn't seem to work, so not enabling
|
|
# rsync could also be optionally enabled
|
|
configureFlags = [
|
|
"--enable-winscp-compat"
|
|
"scponly_PROG_SFTP_SERVER=${lib.getBin openssh}/libexec/sftp-server"
|
|
"scponly_PROG_SCP=${lib.getBin openssh}/bin/scp"
|
|
];
|
|
|
|
postInstall = lib.optionalString (debugLevel > 0) ''
|
|
mkdir -p $out/etc/scponly && echo ${
|
|
toString debugLevel
|
|
} > $out/etc/scponly/debuglevel
|
|
'';
|
|
|
|
passthru.shellPath = "/bin/scponly";
|
|
|
|
meta = with lib; {
|
|
description = "Shell that only permits scp and sftp-server";
|
|
mainProgram = "scponly";
|
|
homepage = "https://github.com/scponly/scponly";
|
|
license = with licenses; [ bsd2 ];
|
|
maintainers = with maintainers; [ wmertens ];
|
|
};
|
|
}
|