aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/common/optional/services/dhcp.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/common/optional/services/dhcp.nix')
-rw-r--r--hosts/common/optional/services/dhcp.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/hosts/common/optional/services/dhcp.nix b/hosts/common/optional/services/dhcp.nix
new file mode 100644
index 0000000..6cfec9c
--- /dev/null
+++ b/hosts/common/optional/services/dhcp.nix
@@ -0,0 +1,21 @@
+{ config, lib, pkgs, ... }:
+{
+
+ environment.systemPackages = with pkgs; [
+ ipxe
+ ];
+
+ services.kea.dhcp4 = {
+ configFile = config.sops.secrets.kea-dhcp4_conf.path;
+ enable = true;
+ };
+
+ 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}" ];
+ };
+ };
+}