-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
99 lines (90 loc) · 2.78 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
description = "sslscan";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
utils.url = "github:numtide/flake-utils";
sslscan-src = {
url = "github:rbsec/sslscan";
flake = false;
};
};
outputs = { self, nixpkgs, utils, sslscan-src }: utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system; overlays = [
self.overlay
(final: prev: {
openssl-zlib = prev.openssl.overrideAttrs (old: {
pname = "openssl";
configureFlags = old.configureFlags ++ [ "-D_FORTIFY_SOURCE=2" "-fPIC" "enable-weak-ssl-ciphers" "zlib" ];
nativeBuildInputs = old.nativeBuildInputs ++ [ final.pkgs.zlib ];
});
})
];
};
sslscan = (with pkgs; stdenv.mkDerivation {
name = "sslscan";
src = sslscan-src;
nativeBuildInputs = [ gnumake gcc ];
buildInputs = [ openssl-zlib ];
buildPhase = ''
make
'';
installPhase = ''
mkdir -p $out/bin
cp sslscan $out/bin/sslscan
'';
meta = with lib; {
description = "sslscan tests SSL/TLS enabled services to discover supported cipher suites";
homepage = https://github.com/rbsec/sslscan;
license = licenses.gpl3Only;
maintainers = with maintainers; [ case ];
};
});
in
rec
{
defaultPackage = sslscan;
packages.${system} = sslscan;
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
nixpkgs-fmt
openssl-zlib
gcc
gnumake
zlib
];
shellHook = ''
ln -s "${sslscan-src}" ./src
'';
};
}) // {
overlay = final: prev: {
openssl-zlib = prev.openssl.overrideAttrs (old: {
pname = "openssl";
configureFlags = old.configureFlags ++ [ "-D_FORTIFY_SOURCE=2" "-fPIC" "enable-weak-ssl-ciphers" "zlib" ];
nativeBuildInputs = old.nativeBuildInputs ++ [ final.pkgs.zlib ];
});
sslscan = with final; (stdenv.mkDerivation {
name = "sslscan";
src = sslscan-src;
nativeBuildInputs = [ gnumake gcc ];
buildInputs = [ openssl-zlib glibc ];
buildPhase = ''
make
'';
installPhase = ''
mkdir -p $out/bin
cp sslscan $out/bin/sslscan
'';
meta = with lib; {
description = "sslscan tests SSL/TLS enabled services to discover supported cipher suites";
homepage = https://github.com/rbsec/sslscan;
license = licenses.gpl3Only;
maintainers = with maintainers; [ case ];
};
});
};
};
}