Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dd72edcdae1e
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e419de361d70
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 10, 2020

  1. nixos/cfdyndns: add apikeyFile option

    nixos/cfdyndns: remove apikey option
    felschr committed Nov 10, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    vdemeester Vincent Demeester
    Copy the full SHA
    a33290b View commit details
  2. Merge pull request #102376 from felschr/feat/cfdyndns-password-file

    nixos/cfdyndns: add apikeyFile option
    aanderse authored Nov 10, 2020
    Copy the full SHA
    e419de3 View commit details
Showing with 17 additions and 5 deletions.
  1. +17 −5 nixos/modules/services/misc/cfdyndns.nix
22 changes: 17 additions & 5 deletions nixos/modules/services/misc/cfdyndns.nix
Original file line number Diff line number Diff line change
@@ -6,6 +6,12 @@ let
cfg = config.services.cfdyndns;
in
{
imports = [
(mkRemovedOptionModule
[ "services" "cfdyndns" "apikey" ]
"Use services.cfdyndns.apikeyFile instead.")
];

options = {
services.cfdyndns = {
enable = mkEnableOption "Cloudflare Dynamic DNS Client";
@@ -17,10 +23,12 @@ in
'';
};

apikey = mkOption {
type = types.str;
apikeyFile = mkOption {
default = null;
type = types.nullOr types.str;
description = ''
The API Key to use to authenticate to CloudFlare.
The path to a file containing the API Key
used to authenticate with CloudFlare.
'';
};

@@ -45,13 +53,17 @@ in
Type = "simple";
User = config.ids.uids.cfdyndns;
Group = config.ids.gids.cfdyndns;
ExecStart = "/bin/sh -c '${pkgs.cfdyndns}/bin/cfdyndns'";
};
environment = {
CLOUDFLARE_EMAIL="${cfg.email}";
CLOUDFLARE_APIKEY="${cfg.apikey}";
CLOUDFLARE_RECORDS="${concatStringsSep "," cfg.records}";
};
script = ''
${optionalString (cfg.apikeyFile != null) ''
export CLOUDFLARE_APIKEY="$(cat ${escapeShellArg cfg.apikeyFile})"
''}
${pkgs.cfdyndns}/bin/cfdyndns
'';
};

users.users = {