git.iko.soy/typeable/nixpkgs
on master help sign in
miredo: init at 1.2.6
commit06b372f24f20dd36cc2b120dbaf0347041fefed3 authorvolth <volth@webmaster.ms> dateSat 31 Dec 2016, 20:03 (10 years ago) parent61027b7
4 files changed+130
nixos/modules/module-list.nix+1 nixos/modules/services/networking/miredo.nix+93 pkgs/tools/networking/miredo/default.nix+34 pkgs/top-level/all-packages.nix+2
nixos/modules/module-list.nix+1
@@ -392,6 +392,7 @@
392392 ./services/networking/minidlna.nix
393393 ./services/networking/miniupnpd.nix
394394 ./services/networking/mosquitto.nix
395+ ./services/networking/miredo.nix
395396 ./services/networking/mstpd.nix
396397 ./services/networking/murmur.nix
397398 ./services/networking/namecoind.nix
nixos/modules/services/networking/miredo.nixnew file+93
@@ -0,0 +1,93 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+ cfg = config.services.miredo;
7+ pidFile = "/run/miredo.pid";
8+ miredoConf = pkgs.writeText "miredo.conf" ''
9+ InterfaceName ${cfg.interfaceName}
10+ ServerAddress ${cfg.serverAddress}
11+ ${optionalString (cfg.bindAddress != null) "BindAddress ${cfg.bindAddress}"}
12+ ${optionalString (cfg.bindPort != null) "BindPort ${cfg.bindPort}"}
13+ '';
14+in
15+{
16+
17+ ###### interface
18+
19+ options = {
20+
21+ services.miredo = {
22+
23+ enable = mkEnableOption "Whether miredo should be run on startup.";
24+
25+ package = mkOption {
26+ type = types.package;
27+ default = pkgs.miredo;
28+ defaultText = "pkgs.miredo";
29+ description = ''
30+ The package to use for the miredo daemon's binary.
31+ '';
32+ };
33+
34+ serverAddress = mkOption {
35+ default = "teredo.remlab.net";
36+ type = types.str;
37+ description = ''
38+ The hostname or primary IPv4 address of the Teredo server.
39+ This setting is required if Miredo runs as a Teredo client.
40+ "teredo.remlab.net" is an experimental service for testing only.
41+ Please use another server for production and/or large scale deployments.
42+ '';
43+ };
44+
45+ interfaceName = mkOption {
46+ default = "teredo";
47+ type = types.str;
48+ description = ''
49+ Name of the network tunneling interface.
50+ '';
51+ };
52+
53+ bindAddress = mkOption {
54+ default = null;
55+ type = types.nullOr types.str;
56+ description = ''
57+ Depending on the local firewall/NAT rules, you might need to force
58+ Miredo to use a fixed UDP port and or IPv4 address.
59+ '';
60+ };
61+
62+ bindPort = mkOption {
63+ default = null;
64+ type = types.nullOr types.str;
65+ description = ''
66+ Depending on the local firewall/NAT rules, you might need to force
67+ Miredo to use a fixed UDP port and or IPv4 address.
68+ '';
69+ };
70+ };
71+ };
72+
73+
74+ ###### implementation
75+
76+ config = mkIf cfg.enable {
77+
78+ systemd.services.miredo = {
79+ wantedBy = [ "multi-user.target" ];
80+ after = [ "network.target" ];
81+ description = "Teredo IPv6 Tunneling Daemon";
82+ serviceConfig = {
83+ Restart = "always";
84+ RestartSec = "5s";
85+ ExecStartPre = "${cfg.package}/bin/miredo-checkconf -f ${miredoConf}";
86+ ExecStart = "${cfg.package}/bin/miredo -c ${miredoConf} -p ${pidFile} -f";
87+ ExecReload = "/bin/kill -HUP $MAINPID";
88+ };
89+ };
90+
91+ };
92+
93+}
pkgs/tools/networking/miredo/default.nixnew file+34
@@ -0,0 +1,34 @@
1+{ stdenv, fetchurl, nettools, iproute, judy }:
2+
3+stdenv.mkDerivation rec {
4+ version = "1.2.6";
5+ name = "miredo-${version}";
6+
7+ buildInputs = [ judy ];
8+
9+ src = fetchurl {
10+ url = "http://www.remlab.net/files/miredo/miredo-${version}.tar.xz";
11+ sha256 = "0j9ilig570snbmj48230hf7ms8kvcwi2wblycqrmhh85lksd49ps";
12+ };
13+
14+ postPatch = ''
15+ substituteInPlace misc/client-hook.bsd \
16+ --replace '/sbin/route' '${nettools}/bin/route' \
17+ --replace '/sbin/ifconfig' '${nettools}/bin/ifconfig'
18+ substituteInPlace misc/client-hook.iproute --replace '/sbin/ip' '${iproute}/bin/ip'
19+ '';
20+
21+ configureFlags = [ "--with-Judy" ];
22+
23+ postInstall = ''
24+ rm -rf $out/lib/systemd $out/var $out/etc/miredo/miredo.conf
25+ '';
26+
27+ meta = with stdenv.lib; {
28+ description = "Teredo IPv6 Tunneling Daemon";
29+ homepage = http://www.remlab.net/miredo/;
30+ license = licenses.gpl2;
31+ maintainers = [ maintainers.volth ];
32+ platforms = platforms.unix;
33+ };
34+}
pkgs/top-level/all-packages.nix+2
@@ -2801,6 +2801,8 @@ in
28012801
28022802 minixml = callPackage ../development/libraries/minixml { };
28032803
2804+ miredo = callPackage ../tools/networking/miredo { };
2805+
28042806 mjpegtoolsFull = callPackage ../tools/video/mjpegtools { };
28052807
28062808 mjpegtools = self.mjpegtoolsFull.override {