diff options
author | Matt Layher <mdlayher@gmail.com> | 2020-01-07 11:52:32 -0500 |
---|---|---|
committer | Jon <jonringer@users.noreply.github.com> | 2020-01-16 12:38:36 -0800 |
commit | 5089214a3dfaf8dc5b0ec3875ce676a231c30f29 (patch) | |
tree | 676a21074a74c77610dfd6a635ae903a6df83f98 /nixos/modules | |
parent | 046730ebdb664bcba35e78e697585e9763f35c6c (diff) | |
download | nixpkgs-5089214a3dfaf8dc5b0ec3875ce676a231c30f29.tar nixpkgs-5089214a3dfaf8dc5b0ec3875ce676a231c30f29.tar.gz nixpkgs-5089214a3dfaf8dc5b0ec3875ce676a231c30f29.tar.bz2 nixpkgs-5089214a3dfaf8dc5b0ec3875ce676a231c30f29.tar.lz nixpkgs-5089214a3dfaf8dc5b0ec3875ce676a231c30f29.tar.xz nixpkgs-5089214a3dfaf8dc5b0ec3875ce676a231c30f29.tar.zst nixpkgs-5089214a3dfaf8dc5b0ec3875ce676a231c30f29.zip |
nixos/corerad: init
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/networking/corerad.nix | 46 |
2 files changed, 47 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 0a078fb4c79..b6d6f199392 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -578,6 +578,7 @@ ./services/networking/connman.nix ./services/networking/consul.nix ./services/networking/coredns.nix + ./services/networking/corerad.nix ./services/networking/coturn.nix ./services/networking/dante.nix ./services/networking/ddclient.nix diff --git a/nixos/modules/services/networking/corerad.nix b/nixos/modules/services/networking/corerad.nix new file mode 100644 index 00000000000..1a2c4aec665 --- /dev/null +++ b/nixos/modules/services/networking/corerad.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.corerad; +in { + meta = { + maintainers = with maintainers; [ mdlayher ]; + }; + + options.services.corerad = { + enable = mkEnableOption "CoreRAD IPv6 NDP RA daemon"; + + configFile = mkOption { + type = types.path; + example = literalExample "\"\${pkgs.corerad}/etc/corerad/corerad.toml\""; + description = "Path to CoreRAD TOML configuration file."; + }; + + package = mkOption { + default = pkgs.corerad; + defaultText = literalExample "pkgs.corerad"; + type = types.package; + description = "CoreRAD package to use."; + }; + }; + + config = mkIf cfg.enable { + systemd.services.corerad = { + description = "CoreRAD IPv6 NDP RA daemon"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + LimitNPROC = 512; + LimitNOFILE = 1048576; + CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_RAW"; + AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_RAW"; + NoNewPrivileges = true; + DynamicUser = true; + ExecStart = "${getBin cfg.package}/bin/corerad -c=${cfg.configFile}"; + Restart = "on-failure"; + }; + }; + }; +} |