tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
libhsts: ini at 0.1.0
Sandro Jäckel
5 years ago
a4402edf
2f46ed8e
+55
3 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
libhsts
default.nix
update.sh
top-level
all-packages.nix
+40
pkgs/development/libraries/libhsts/default.nix
···
1
1
+
{ lib, stdenv, fetchFromGitLab, fetchurl, autoconf-archive, autoreconfHook, pkg-config, python3 }:
2
2
+
let
3
3
+
chromium_version = "90.0.4417.1";
4
4
+
5
5
+
hsts_list = fetchurl {
6
6
+
url = "https://raw.github.com/chromium/chromium/${chromium_version}/net/http/transport_security_state_static.json";
7
7
+
sha256 = "09f24n30x5dmqk8zk7k2glcilgr27832a3304wj1yp97158sqsfx";
8
8
+
};
9
9
+
10
10
+
in
11
11
+
stdenv.mkDerivation rec {
12
12
+
pname = "libhsts";
13
13
+
version = "0.1.0";
14
14
+
15
15
+
src = fetchFromGitLab {
16
16
+
owner = "rockdaboot";
17
17
+
repo = pname;
18
18
+
rev = "libhsts-${version}";
19
19
+
sha256 = "0gbchzf0f4xzb6zjc56dk74hqrmdgyirmgxvvsqp9vqn9wb5kkx4";
20
20
+
};
21
21
+
22
22
+
postPatch = ''
23
23
+
pushd tests
24
24
+
cp ${hsts_list} transport_security_state_static.json
25
25
+
sed 's/^ *\/\/.*$//g' transport_security_state_static.json >hsts.json
26
26
+
popd
27
27
+
patchShebangs src/hsts-make-dafsa
28
28
+
'';
29
29
+
30
30
+
nativeBuildInputs = [ autoconf-archive autoreconfHook pkg-config python3 ];
31
31
+
32
32
+
outputs = [ "out" "dev" ];
33
33
+
34
34
+
meta = with lib; {
35
35
+
description = "Library to easily check a domain against the Chromium HSTS Preload list";
36
36
+
homepage = "https://gitlab.com/rockdaboot/libhsts";
37
37
+
license = with licenses; [ mit bsd3 ];
38
38
+
maintainers = with maintainers; [ SuperSandro2000 ];
39
39
+
};
40
40
+
}
+13
pkgs/development/libraries/libhsts/update.sh
···
1
1
+
#!/usr/bin/env nix-shell
2
2
+
#!nix-shell -i bash -p curl jq
3
3
+
4
4
+
set -euo pipefail -x
5
5
+
6
6
+
cd "$(dirname "$0")"
7
7
+
8
8
+
chromium_version=$(curl -s "https://api.github.com/repos/chromium/chromium/tags" | jq -r 'map(select(.prerelease | not)) | .[1].name')
9
9
+
sha256=$(nix-prefetch-url "https://raw.github.com/chromium/chromium/$chromium_version/net/http/transport_security_state_static.json")
10
10
+
11
11
+
sed -e "0,/chromium_version/s/chromium_version = \".*\"/chromium_version = \"$chromium_version\"/" \
12
12
+
-e "0,/sha256/s/sha256 = \".*\"/sha256 = \"$sha256\"/" \
13
13
+
--in-place ./default.nix
+2
pkgs/top-level/all-packages.nix
···
13841
13841
13842
13842
libgit2-glib = callPackage ../development/libraries/libgit2-glib { };
13843
13843
13844
13844
+
libhsts = callPackage ../development/libraries/libhsts { };
13845
13845
+
13844
13846
glbinding = callPackage ../development/libraries/glbinding { };
13845
13847
13846
13848
gle = callPackage ../development/libraries/gle { };