diff options
Diffstat (limited to 'hosts/common/optional')
-rw-r--r-- | hosts/common/optional/services/dhcp.nix | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/hosts/common/optional/services/dhcp.nix b/hosts/common/optional/services/dhcp.nix index 034ef67..728805d 100644 --- a/hosts/common/optional/services/dhcp.nix +++ b/hosts/common/optional/services/dhcp.nix @@ -31,12 +31,31 @@ }; }; - systemd.services.kea-dhcp4-server = { - serviceConfig = { - ExecStart = lib.mkForce '' - ${pkgs.kea}/bin/kea-dhcp4 -c ''${CREDENTIALS_DIRECTORY}/kea-dhcp4_conf - ''; - LoadCredential = [ "kea-dhcp4_conf:${config.sops.secrets.kea-dhcp4_conf.path}" ]; + systemd.services = { + kea-dhcp4-server = { + serviceConfig = { + ExecStart = lib.mkForce '' + ${pkgs.kea}/bin/kea-dhcp4 -c ''${CREDENTIALS_DIRECTORY}/kea-dhcp4_conf + ''; + LoadCredential = [ "kea-dhcp4_conf:${config.sops.secrets.kea-dhcp4_conf.path}" ]; + }; + }; + + tftpd = { + after = [ "network.target" ]; + description = "TFTP server"; + serviceConfig = { + User = "root"; + Group = "root"; + Restart = "always"; + RestartSec = 5; + Type = "exec"; + ExecStart = "${pkgs.tftp-hpa}/bin/in.tftpd -l -a 192.168.1.1:69 -P /run/tftpd.pid /etc/tftp"; + TimeoutStopSec = 20; + PIDFile = "/run/tftpd.pid"; + }; + wantedBy = [ "multi-user.target" ]; + after = [ "nftables.service" ]; }; }; } |