summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2022-05-22 17:08:55 +0200
committerGitHub <noreply@github.com>2022-05-22 17:08:55 +0200
commit05232d19b68ff95c23571f782b552eaf71e0a742 (patch)
tree2bdb466e3f3f4dac452cd548b35c7a67230b97cd
parent3d4e586313d292c9e764a8e88a1fdccb16ffb2d3 (diff)
parent8b250ec5af57b8a72b3b35c39d3f0cf12e441eab (diff)
downloadnixpkgs-05232d19b68ff95c23571f782b552eaf71e0a742.tar
nixpkgs-05232d19b68ff95c23571f782b552eaf71e0a742.tar.gz
nixpkgs-05232d19b68ff95c23571f782b552eaf71e0a742.tar.bz2
nixpkgs-05232d19b68ff95c23571f782b552eaf71e0a742.tar.lz
nixpkgs-05232d19b68ff95c23571f782b552eaf71e0a742.tar.xz
nixpkgs-05232d19b68ff95c23571f782b552eaf71e0a742.tar.zst
nixpkgs-05232d19b68ff95c23571f782b552eaf71e0a742.zip
Merge pull request #163220 from fleaz/init-r53_ddns
-rw-r--r--maintainers/maintainer-list.nix7
-rw-r--r--nixos/doc/manual/from_md/release-notes/rl-2205.section.xml8
-rw-r--r--nixos/doc/manual/release-notes/rl-2205.section.md2
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/networking/r53-ddns.nix72
-rw-r--r--pkgs/applications/networking/r53-ddns/default.nix22
-rw-r--r--pkgs/top-level/all-packages.nix2
7 files changed, 114 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 448160605a1..d8eaff4a0d8 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -4254,6 +4254,13 @@
       fingerprint = "2F93 661D AC17 EA98 A104  F780 ECC7 55EE 583C 1672";
     }];
   };
+  fleaz = {
+    email = "mail@felixbreidenstein.de";
+    matrix = "@fleaz:rainbownerds.de";
+    github = "fleaz";
+    githubId = 2489598;
+    name = "Felix Breidenstein";
+  };
   flexagoon = {
     email = "flexagoon@pm.me";
     github = "flexagoon";
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
index aafa9b831b6..a660e28af04 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
@@ -233,6 +233,14 @@
       </listitem>
       <listitem>
         <para>
+          <link xlink:href="https://github.com/fleaz/r53-ddns">r53-ddns</link>,
+          a small tool to run your own DDNS service via AWS Route53.
+          Available as
+          <link xlink:href="options.html#opt-services.r53-ddns.enable">services.r53-ddns</link>.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
           <link xlink:href="https://ergo.chat">ergochat</link>, a modern
           IRC with IRCv3 features. Available as
           <link xlink:href="options.html#opt-services.ergochat.enable">services.ergochat</link>.
diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md
index 52bcc2e80d9..96b138aa82e 100644
--- a/nixos/doc/manual/release-notes/rl-2205.section.md
+++ b/nixos/doc/manual/release-notes/rl-2205.section.md
@@ -75,6 +75,8 @@ In addition to numerous new and upgraded packages, this release has the followin
 
 - [snowflake-proxy](https://snowflake.torproject.org/), a system to defeat internet censorship. Available as [services.snowflake-proxy](options.html#opt-services.snowflake-proxy.enable).
 
+- [r53-ddns](https://github.com/fleaz/r53-ddns), a small tool to run your own DDNS service via AWS Route53. Available as [services.r53-ddns](options.html#opt-services.r53-ddns.enable).
+
 - [ergochat](https://ergo.chat), a modern IRC with IRCv3 features. Available as [services.ergochat](options.html#opt-services.ergochat.enable).
 
 - [Snipe-IT](https://snipeitapp.com), a free open source IT asset/license management system. Available as [services.snipe-it](options.html#opt-services.snipe-it.enable).
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 35de34aac10..2607e99d845 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -877,6 +877,7 @@
   ./services/networking/quassel.nix
   ./services/networking/quorum.nix
   ./services/networking/quicktun.nix
+  ./services/networking/r53-ddns.nix
   ./services/networking/radicale.nix
   ./services/networking/radvd.nix
   ./services/networking/rdnssd.nix
diff --git a/nixos/modules/services/networking/r53-ddns.nix b/nixos/modules/services/networking/r53-ddns.nix
new file mode 100644
index 00000000000..a8839762d53
--- /dev/null
+++ b/nixos/modules/services/networking/r53-ddns.nix
@@ -0,0 +1,72 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.r53-ddns;
+  pkg = pkgs.r53-ddns;
+in
+{
+  options = {
+    services.r53-ddns = {
+
+      enable = mkEnableOption "r53-ddyns";
+
+      interval = mkOption {
+        type = types.str;
+        default = "15min";
+        description = "How often to update the entry";
+      };
+
+      zoneID = mkOption {
+        type = types.str;
+        description = "The ID of your zone in Route53";
+      };
+
+      domain = mkOption {
+        type = types.str;
+        description = "The name of your domain in Route53";
+      };
+
+      hostname = mkOption {
+        type = types.str;
+        description = ''
+          Manually specify the hostname. Otherwise the tool will try to use the name
+          returned by the OS (Call to gethostname)
+        '';
+      };
+
+      environmentFile = mkOption {
+        type = types.str;
+        description = ''
+          File containing the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
+          in the format of an EnvironmentFile as described by systemd.exec(5)
+        '';
+      };
+
+    };
+  };
+
+  config = mkIf cfg.enable {
+
+    systemd.timers.r53-ddns = {
+      description = "r53-ddns timer";
+      wantedBy = [ "timers.target" ];
+      timerConfig = {
+        OnBootSec = cfg.interval;
+        OnUnitActiveSec = cfg.interval;
+      };
+    };
+
+    systemd.services.r53-ddns = {
+      description = "r53-ddns service";
+      serviceConfig = {
+        ExecStart = "${pkg}/bin/r53-ddns -zone-id ${cfg.zoneID} -domain ${cfg.domain}"
+          + lib.optionalString (cfg.hostname != null) " -hostname ${cfg.hostname}";
+        EnvironmentFile = "${cfg.environmentFile}";
+        DynamicUser = true;
+      };
+    };
+
+  };
+}
diff --git a/pkgs/applications/networking/r53-ddns/default.nix b/pkgs/applications/networking/r53-ddns/default.nix
new file mode 100644
index 00000000000..e34d6495d9b
--- /dev/null
+++ b/pkgs/applications/networking/r53-ddns/default.nix
@@ -0,0 +1,22 @@
+{ buildGoModule, fetchFromGitHub, lib }:
+
+buildGoModule rec {
+  pname = "r53-ddns";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "fleaz";
+    repo = "r53-ddns";
+    rev = "v${version}";
+    sha256 = "sha256:1pvd1karq1p81rkq2n7mh040n29f7wb8701ax6g2sqm1yz7gxd08";
+  };
+
+  vendorSha256 = "sha256:1jhwds57gi548ahnh5m342csrs5rv9ysy7fqmfvg5w2s9slswq77";
+
+  meta = with lib; {
+    license = licenses.mit;
+    homepage = "https://github.com/fleaz/r53-ddns";
+    description = "A DIY DynDNS tool based on Route53";
+    maintainers = with maintainers; [ fleaz ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6707508cc04..14e363c6b3e 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -4147,6 +4147,8 @@ with pkgs;
 
   psrecord = python3Packages.callPackage ../tools/misc/psrecord {};
 
+  r53-ddns = callPackage ../applications/networking/r53-ddns { };
+
   rare = python3Packages.callPackage ../games/rare { };
 
   reg = callPackage ../tools/virtualization/reg { };