-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Open
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOSIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS9.needs: module (new)This needs a module to be createdThis needs a module to be created
Description
Nixpkgs version
- Unstable (25.05)
Describe the proposed module
in #391247 package allows to monitor zerotier interfaces and update DNS periodically. To use this in NixOS, there should be a module to allow that.
Additional context
I've done this for my personal use
{
pkgs,
lib,
config,
...
}:
let
cfg = config.services.zerotier-systemd-manager;
in
{
options.services.zerotier-systemd-manager = {
enable = lib.mkEnableOption "Zerotier DNS Update Service";
package = lib.mkPackageOption pkgs "zerotier-systemd-manager" { };
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = config.systemd.network.enable;
message = ''
This module relies on systemd-networkd to manage DNS records per iterface,
please enable it with
systemd.network.enable = true.
In case you use NetworkManager, you might also need
systemd.network.wait-online.enable = false;
See more info on how to enable systemd-networkd in https://nixos.wiki/wiki/Systemd-networkd
'';
}
];
systemd.services.zerotier-dns-update = {
description = "Update zerotier per-interface DNS settings";
requires = [ "zerotierone.service" ];
after = [ "zerotierone.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${cfg.package}/bin/zerotier-systemd-manager";
};
};
systemd.timers.zerotier-dns-update = {
description = "Update zerotier per-interface DNS settings";
wantedBy = [ "timers.target" ];
timerConfig = {
OnStartupSec = "1min";
OnUnitInactiveSec = "1min";
};
unitConfig = {
Description = "Update zerotier per-interface DNS settings";
};
};
};
}Notify maintainers
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this module does not yet exist in an open pull request or in NixOS Unstable.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOSIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS9.needs: module (new)This needs a module to be createdThis needs a module to be created