Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unFTP: init at 0.14.5 #281588

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15378,6 +15378,12 @@
github = "rafaelrc7";
githubId = 5376043;
};
rafaelsgirao = {
email = "git-nixpkgs@rafael.ovh";
github = "rafaelsgirao";
githubId = 7544832;
name = "Rafael Girão";
};
Comment on lines +15381 to +15386
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit adding you as a maintainer should come before the package commit (:

ragge = {
email = "r.dahlen@gmail.com";
github = "ragnard";
Expand Down
35 changes: 35 additions & 0 deletions pkgs/servers/unftp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ lib
, linux-pam
, rustPlatform
, fetchFromGitHub
, buildFeatures ? [ "gnu" ]
}:

rustPlatform.buildRustPackage rec {
pname = "unFTP";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pname = "unFTP";
pname = "unftp";

pname must not contain uppercase letters.

version = "0.14.5";

src = fetchFromGitHub {
owner = "bolcom";
repo = pname;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pname and repo are not considered the same and can cause issues down the path.

Suggested change
repo = pname;
repo = "unFTP";

rev = "v${version}";
sha256 = "sha256-CPq4CH7reS5AI145l8U1nekm2MKnmoBfVqENR9QOKF4";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sha256 = "sha256-CPq4CH7reS5AI145l8U1nekm2MKnmoBfVqENR9QOKF4";
hash = "sha256-CPq4CH7reS5AI145l8U1nekm2MKnmoBfVqENR9QOKF4";

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is hash preferred over sha256? I used to use hash, but thought being explicit on the hash type was better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "sha256-" part of the hash is already making it specific (:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll provide some more details.

This comes from nix adding support for SRI hashes, using the hash argument. There are several reasons why SRI hashes are preferred to normal hashes, but I believe most of it comes down to compatibility with the rest of the ecosystem. Somewhere along the road, the old to-be-deprecated-at-some-point arguments like sha256 also started accepting SRI hashes, creating a bit of confusion. There has been discussions around disabling this behavior to be more consistent, but nothing has been done at the moment. Also see RFC 131 for some relevant discussions.

You'll frequently see reviewers add this suggestion to both new packages, but also version bumps for packages that still use the "legacy" hashes (with legacy in quotes because AFAIK they haven't been officially deprecated anywhere)

};

#Extra cargo Build Features
inherit buildFeatures;

buildInputs = [
linux-pam
];

cargoSha256 = "sha256-vFu1D2GYItVGeTmd/rwmZHM/mf4zQ3tzBLux7vb+yZ0=";

meta = with lib; {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the meta.mainProgram tag.

description = "A FTP(S) server with a couple of twists written in Rust";
homepage = "https://unftp.rs";
license = licenses.asl20;
maintainers = with maintainers; [ rafaelsgirao ];
platforms = platforms.unix;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit unsure if this is reasonable, considering that we build it with gnu features and use linux-pam. I haven't looked further into it, but it sounds like this package would only run on linux, and not something like OpenBSD.

};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26838,6 +26838,8 @@ with pkgs;

system-sendmail = lowPrio (callPackage ../servers/mail/system-sendmail { });

unFTP = callPackage ../servers/unftp { };

Comment on lines +26841 to +26842
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package should be placed under the pkgs/by-name/so/some-package/package.nix hierarchy. Which would make this unnecessary.

Suggested change
unFTP = callPackage ../servers/unftp { };

# PulseAudio daemons

hsphfpd = callPackage ../servers/pulseaudio/hsphfpd.nix { };
Expand Down