From bc25565ebf85431c1def5ee88ca0922734d8fd9b Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Sat, 9 Nov 2024 19:46:51 -0800 Subject: Move to standalone tftpd --- hosts/common/optional/services/dhcp.nix | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'hosts/common/optional/services/dhcp.nix') 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" ]; }; }; } -- cgit v1.2.3