python312Packages.aiohomeconnect: 0.10.0 -> 0.11.0 (#374011)
[NixPkgs.git] / nixos / modules / services / networking / fakeroute.nix
bloba877a0d7d211e8ed5d1ee972d518754bb0e04117
2   config,
3   lib,
4   pkgs,
5   ...
6 }:
8 let
9   cfg = config.services.fakeroute;
10   routeConf = pkgs.writeText "route.conf" (lib.concatStringsSep "\n" cfg.route);
16   ###### interface
18   options = {
20     services.fakeroute = {
22       enable = lib.mkEnableOption "the fakeroute service";
24       route = lib.mkOption {
25         type = with lib.types; listOf str;
26         default = [ ];
27         example = [
28           "216.102.187.130"
29           "4.0.1.122"
30           "198.116.142.34"
31           "63.199.8.242"
32         ];
33         description = ''
34           Fake route that will appear after the real
35           one to any host running a traceroute.
36         '';
37       };
39     };
41   };
43   ###### implementation
45   config = lib.mkIf cfg.enable {
46     systemd.services.fakeroute = {
47       description = "Fakeroute Daemon";
48       after = [ "network.target" ];
49       wantedBy = [ "multi-user.target" ];
50       serviceConfig = {
51         Type = "forking";
52         User = "fakeroute";
53         DynamicUser = true;
54         AmbientCapabilities = [ "CAP_NET_RAW" ];
55         ExecStart = "${pkgs.fakeroute}/bin/fakeroute -f ${routeConf}";
56       };
57     };
59   };
61   meta.maintainers = with lib.maintainers; [ rnhmjoj ];