diff options
author | pokon548 <65808665+pokon548@users.noreply.github.com> | 2023-08-07 14:32:32 +0800 |
---|---|---|
committer | pokon548 <65808665+pokon548@users.noreply.github.com> | 2023-08-07 14:32:32 +0800 |
commit | dcf5ae3d0b21d7b70c049c37f3a8ec7fe1cf1352 (patch) | |
tree | 6918f86763631f01740f4e8d8830c63a3a1582cb /nixos | |
parent | 2e93b24ced0e4be0de47362c3d32d2537f8cab56 (diff) |
nixos/dae: init
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/networking/dae.nix | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 29fcabaefad51..29249b75d29fb 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -863,6 +863,7 @@ ./services/networking/coturn.nix ./services/networking/create_ap.nix ./services/networking/croc.nix + ./services/networking/dae.nix ./services/networking/dante.nix ./services/networking/dhcpcd.nix ./services/networking/dnscache.nix diff --git a/nixos/modules/services/networking/dae.nix b/nixos/modules/services/networking/dae.nix new file mode 100644 index 0000000000000..b0ad2c0d4bb06 --- /dev/null +++ b/nixos/modules/services/networking/dae.nix @@ -0,0 +1,41 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.services.dae; +in +{ + meta.maintainers = with lib.maintainers; [ pokon548 ]; + + options = { + services.dae = { + enable = lib.options.mkEnableOption (lib.mdDoc "the dae service"); + package = lib.mkPackageOptionMD pkgs "dae" { }; + }; + }; + + config = lib.mkIf config.services.dae.enable { + networking.firewall.allowedTCPPorts = [ 12345 ]; + networking.firewall.allowedUDPPorts = [ 12345 ]; + + systemd.services.dae = { + unitConfig = { + Description = "dae Service"; + Documentation = "https://github.com/daeuniverse/dae"; + After = [ "network.target" "systemd-sysctl.service" ]; + Wants = [ "network.target" ]; + }; + + serviceConfig = { + User = "root"; + ExecStartPre = "${lib.getExe cfg.package} validate -c /etc/dae/config.dae"; + ExecStart = "${lib.getExe cfg.package} run --disable-timestamp -c /etc/dae/config.dae"; + ExecReload = "${lib.getExe cfg.package} reload $MAINPID"; + LimitNPROC = 512; + LimitNOFILE = 1048576; + Restart = "on-abnormal"; + Type = "notify"; + }; + + wantedBy = [ "multi-user.target" ]; + }; + }; +} |