From 2e93b24ced0e4be0de47362c3d32d2537f8cab56 Mon Sep 17 00:00:00 2001 From: pokon548 <65808665+pokon548@users.noreply.github.com> Date: Mon, 7 Aug 2023 14:31:29 +0800 Subject: [PATCH 1/3] maintainers: add pokon548 --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 8a468301ea5d..7d214c085fae 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -13476,6 +13476,12 @@ githubId = 38314551; name = "Peter Okelmann"; }; + pokon548 = { + email = "nix@bukn.uk"; + github = "pokon548"; + githubId = 65808665; + name = "Bu Kun"; + }; polarmutex = { email = "brian@brianryall.xyz"; github = "polarmutex"; From dcf5ae3d0b21d7b70c049c37f3a8ec7fe1cf1352 Mon Sep 17 00:00:00 2001 From: pokon548 <65808665+pokon548@users.noreply.github.com> Date: Mon, 7 Aug 2023 14:32:32 +0800 Subject: [PATCH 2/3] nixos/dae: init --- nixos/modules/module-list.nix | 1 + nixos/modules/services/networking/dae.nix | 41 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 nixos/modules/services/networking/dae.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 29fcabaefad5..29249b75d29f 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 000000000000..b0ad2c0d4bb0 --- /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" ]; + }; + }; +} From 872d49d1881b66fcdbf1455acc3b34d6653b6741 Mon Sep 17 00:00:00 2001 From: pokon548 <65808665+pokon548@users.noreply.github.com> Date: Mon, 7 Aug 2023 14:33:33 +0800 Subject: [PATCH 3/3] dae: add meta.mainProgram --- pkgs/tools/networking/dae/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/dae/default.nix b/pkgs/tools/networking/dae/default.nix index 7abd3975eaff..9c874f860d27 100644 --- a/pkgs/tools/networking/dae/default.nix +++ b/pkgs/tools/networking/dae/default.nix @@ -58,7 +58,8 @@ buildGoModule rec { description = "A Linux high-performance transparent proxy solution based on eBPF"; homepage = "https://github.com/daeuniverse/dae"; license = licenses.agpl3Only; - maintainers = with maintainers; [ oluceps ]; + maintainers = with maintainers; [ oluceps pokon548 ]; platforms = platforms.linux; + mainProgram = "dae"; }; }