Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
64 lines
1.2 KiB
Nix
64 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.services.fakeroute;
|
|
routeConf = pkgs.writeText "route.conf" (lib.concatStringsSep "\n" cfg.route);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.fakeroute = {
|
|
|
|
enable = lib.mkEnableOption "the fakeroute service";
|
|
|
|
route = lib.mkOption {
|
|
type = with lib.types; listOf str;
|
|
default = [ ];
|
|
example = [
|
|
"216.102.187.130"
|
|
"4.0.1.122"
|
|
"198.116.142.34"
|
|
"63.199.8.242"
|
|
];
|
|
description = ''
|
|
Fake route that will appear after the real
|
|
one to any host running a traceroute.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
###### implementation
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.services.fakeroute = {
|
|
description = "Fakeroute Daemon";
|
|
after = [ "network.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
Type = "forking";
|
|
User = "fakeroute";
|
|
DynamicUser = true;
|
|
AmbientCapabilities = [ "CAP_NET_RAW" ];
|
|
ExecStart = "${pkgs.fakeroute}/bin/fakeroute -f ${routeConf}";
|
|
};
|
|
};
|
|
|
|
};
|
|
|
|
meta.maintainers = with lib.maintainers; [ rnhmjoj ];
|
|
|
|
}
|