tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
Merge branch 'tlsdate' of git://github.com/4z3/nixpkgs
Shea Levy
11 years ago
52d4b9d9
b35e0a09
+154
4 changed files
expand all
collapse all
unified
split
nixos
modules
module-list.nix
services
networking
tlsdated.nix
pkgs
tools
networking
tlsdate
default.nix
top-level
all-packages.nix
+1
nixos/modules/module-list.nix
reviewed
···
292
292
./services/networking/tcpcrypt.nix
293
293
./services/networking/teamspeak3.nix
294
294
./services/networking/tftpd.nix
295
295
+
./services/networking/tlsdated.nix
295
296
./services/networking/tox-bootstrapd.nix
296
297
./services/networking/unbound.nix
297
298
./services/networking/unifi.nix
+110
nixos/modules/services/networking/tlsdated.nix
reviewed
···
1
1
+
{ config, lib, pkgs, ... }:
2
2
+
3
3
+
with lib;
4
4
+
5
5
+
let
6
6
+
inherit (pkgs) coreutils tlsdate;
7
7
+
8
8
+
cfg = config.services.tlsdated;
9
9
+
in
10
10
+
11
11
+
{
12
12
+
13
13
+
###### interface
14
14
+
15
15
+
options = {
16
16
+
17
17
+
services.tlsdated = {
18
18
+
19
19
+
enable = mkOption {
20
20
+
type = types.bool;
21
21
+
default = false;
22
22
+
description = ''
23
23
+
Enable tlsdated daemon.
24
24
+
'';
25
25
+
};
26
26
+
27
27
+
extraOptions = mkOption {
28
28
+
type = types.string;
29
29
+
description = ''
30
30
+
Additional command line arguments to pass to tlsdated.
31
31
+
'';
32
32
+
};
33
33
+
34
34
+
sources = mkOption {
35
35
+
type = types.listOf (types.submodule {
36
36
+
options = {
37
37
+
host = mkOption {
38
38
+
type = types.string;
39
39
+
description = ''
40
40
+
Remote hostname.
41
41
+
'';
42
42
+
};
43
43
+
port = mkOption {
44
44
+
type = types.int;
45
45
+
description = ''
46
46
+
Remote port.
47
47
+
'';
48
48
+
};
49
49
+
proxy = mkOption {
50
50
+
type = types.nullOr types.string;
51
51
+
default = null;
52
52
+
description = ''
53
53
+
The proxy argument expects HTTP, SOCKS4A or SOCKS5 formatted as followed:
54
54
+
55
55
+
http://127.0.0.1:8118
56
56
+
socks4a://127.0.0.1:9050
57
57
+
socks5://127.0.0.1:9050
58
58
+
59
59
+
The proxy support should not leak DNS requests and is suitable for use with Tor.
60
60
+
'';
61
61
+
};
62
62
+
};
63
63
+
});
64
64
+
default = [
65
65
+
{
66
66
+
host = "www.ptb.de";
67
67
+
port = 443;
68
68
+
proxy = null;
69
69
+
}
70
70
+
];
71
71
+
description = ''
72
72
+
You can list one or more sources to fetch time from.
73
73
+
'';
74
74
+
};
75
75
+
76
76
+
};
77
77
+
78
78
+
};
79
79
+
80
80
+
###### implementation
81
81
+
82
82
+
config = mkIf cfg.enable {
83
83
+
84
84
+
# Make tools such as tlsdate available in the system path
85
85
+
environment.systemPackages = [ tlsdate ];
86
86
+
87
87
+
systemd.services.tlsdated = {
88
88
+
description = "tlsdated daemon";
89
89
+
wantedBy = [ "multi-user.target" ];
90
90
+
serviceConfig = {
91
91
+
# XXX because pkgs.tlsdate is compiled to run as nobody:nogroup, we
92
92
+
# hard-code base-path to /tmp and use PrivateTmp.
93
93
+
ExecStart = "${tlsdate}/bin/tlsdated -f ${pkgs.writeText "tlsdated.confg" ''
94
94
+
base-path /tmp
95
95
+
96
96
+
${concatMapStrings (src: ''
97
97
+
source
98
98
+
host ${src.host}
99
99
+
port ${toString src.port}
100
100
+
proxy ${if src.proxy == null then "none" else src.proxy}
101
101
+
end
102
102
+
'') cfg.sources}
103
103
+
''} ${cfg.extraOptions}";
104
104
+
PrivateTmp = "yes";
105
105
+
};
106
106
+
};
107
107
+
108
108
+
};
109
109
+
110
110
+
}
+41
pkgs/tools/networking/tlsdate/default.nix
reviewed
···
1
1
+
{ stdenv, fetchgit
2
2
+
, autoconf
3
3
+
, automake
4
4
+
, libevent
5
5
+
, libtool
6
6
+
, pkgconfig
7
7
+
, openssl
8
8
+
}:
9
9
+
10
10
+
stdenv.mkDerivation {
11
11
+
name = "tlsdate-0.0.12";
12
12
+
13
13
+
src = fetchgit {
14
14
+
url = https://github.com/ioerror/tlsdate;
15
15
+
rev = "fd04f48ed60eb773c8e34d27ef2ee12ee7559a41";
16
16
+
sha256 = "d97b7cc6fe64799c12c31a9ebd3a69c9bc954de2eaa7f70d113d39544472854d";
17
17
+
};
18
18
+
19
19
+
buildInputs = [
20
20
+
autoconf
21
21
+
automake
22
22
+
libevent
23
23
+
libtool
24
24
+
pkgconfig
25
25
+
openssl
26
26
+
];
27
27
+
28
28
+
preConfigure = ''
29
29
+
export COMPILE_DATE=0
30
30
+
./autogen.sh
31
31
+
'';
32
32
+
33
33
+
doCheck = true;
34
34
+
35
35
+
meta = {
36
36
+
description = "Secure parasitic rdate replacement";
37
37
+
homepage = https://github.com/ioerror/tlsdate;
38
38
+
platforms = stdenv.lib.platforms.all;
39
39
+
maintainers = [ stdenv.lib.maintainers.tv ];
40
40
+
};
41
41
+
}
+2
pkgs/top-level/all-packages.nix
reviewed
···
2654
2654
2655
2655
tiny8086 = callPackage ../applications/virtualization/8086tiny { };
2656
2656
2657
2657
+
tlsdate = callPackage ../tools/networking/tlsdate { };
2658
2658
+
2657
2659
tmpwatch = callPackage ../tools/misc/tmpwatch { };
2658
2660
2659
2661
tmux = callPackage ../tools/misc/tmux { };