Repository navigation
zlint: init at 3.4.0 - #201537
zlint: init at 3.4.0#201537
Conversation
azahi
left a comment
There was a problem hiding this comment.
There were a lot of changes which I wanted to suggest so it would be easier if I just drop a patch for you to apply.
diff --git i/pkgs/tools/security/zlint/default.nix w/pkgs/tools/security/zlint/default.nix
index 4116e3bf717..9d85b181a62 100644
--- i/pkgs/tools/security/zlint/default.nix
+++ w/pkgs/tools/security/zlint/default.nix
@@ -1,4 +1,10 @@
-{ buildGoModule, fetchFromGitHub, lib }:
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, git
+, testers
+, zlint
+}:
buildGoModule rec {
pname = "zlint";
@@ -6,25 +12,54 @@ buildGoModule rec {
src = fetchFromGitHub {
owner = "zmap";
- repo = pname;
+ repo = "zlint";
rev = "v${version}";
- sha256 = "sha256-l39GdfEKUAw5DQNjx6ZBgfGtengRlUUasm0G07kAA2A=";
+ leaveDotGit = true;
+ hash = "sha256-1T8WAWsivSEB2xVEM+GpWJuD3DGXPa9uNpuN6/ABsns=";
};
modRoot = "v3";
+
vendorHash = "sha256-OiHEyMHuSiWDB/1YRvAhErb1h/rFfXXVcagcP386doc=";
- preBuild = ''
- # not in the go.mod
- rm -rf cmd/genTestCerts
+
+ postPatch = ''
+ # Remove a package which is not declared in go.mod.
+ rm -rf v3/cmd/genTestCerts
+ '';
+
+ subPackages = [
+ "cmd/zlint"
+ "cmd/zlint-gtld-update"
+ ];
+
+ ldflags = [
+ "-s"
+ "-w"
+ "-X main.version=${version}"
+ ];
+
+ checkInputs = [ git ];
+
+ preCheck = ''
+ # Test all targets.
+ unset subPackages
'';
- # Tests rely on git and we don't have the .git dir because modRoot is in a subdir
- doCheck = false;
+ passthru.tests.version = testers.testVersion {
+ package = zlint;
+ command = "zlint -version";
+ };
meta = with lib; {
- homepage = "https://github.com/zmap/zlint/";
+ description = "X.509 Certificate Linter focused on Web PKI standards and requirements";
+ longDescription = ''
+ ZLint is a X.509 certificate linter written in Go that checks for
+ consistency with standards (e.g. RFC 5280) and other relevant PKI
+ requirements (e.g. CA/Browser Forum Baseline Requirements).
+ '';
+ homepage = "https://github.com/zmap/zlint";
+ changelog = "https://github.com/zmap/zlint/releases/tag/${src.rev}";
license = licenses.asl20;
- description = "X.509 Certificate Linter focused on Web PKI standards and requirements.";
maintainers = with maintainers; [ baloo ];
};
}Here's the complete file if applying didn't work.
|
@azahi that is a lot more than I know about! Would you want to be added in the maintainers maybe? (in any case, thank you!) |
b1530ee to
3f05a60
Compare
|
The build currently fails due to a hash mismatch, could you please fix that. Otherwise I think we're good.
That's not necessary. |
|
@azahi the hash mismatch is inconsistent. |
|
0877662 to
52c8fe6
Compare
52c8fe6 to
12df3ab
Compare
azahi
left a comment
There was a problem hiding this comment.
That's weird, but I guess we can just drop checks. LGTM.
| # Checks rely on .git directory, leaveDotGit makes the source derivation flaky. | ||
| doCheck = false; |
There was a problem hiding this comment.
Can we patch that it requires a git directory?
There was a problem hiding this comment.
that got dropped in 3.4.1 which just released on Sunday and that I missed.
#202590
Description of changes
This adds
zlintwhich is a linter for certificates.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes