zerotier-one: service add
This commit is contained in:
parent
82b74ae425
commit
5297371b95
|
@ -333,6 +333,7 @@
|
||||||
./services/networking/wicd.nix
|
./services/networking/wicd.nix
|
||||||
./services/networking/wpa_supplicant.nix
|
./services/networking/wpa_supplicant.nix
|
||||||
./services/networking/xinetd.nix
|
./services/networking/xinetd.nix
|
||||||
|
./services/networking/zerotierone.nix
|
||||||
./services/networking/znc.nix
|
./services/networking/znc.nix
|
||||||
./services/printing/cupsd.nix
|
./services/printing/cupsd.nix
|
||||||
./services/scheduling/atd.nix
|
./services/scheduling/atd.nix
|
||||||
|
|
32
nixos/modules/services/networking/zerotierone.nix
Normal file
32
nixos/modules/services/networking/zerotierone.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.zerotierone;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.services.zerotierone.enable = mkEnableOption "ZeroTierOne";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.services.zerotierone = {
|
||||||
|
description = "ZeroTierOne";
|
||||||
|
path = [ pkgs.zerotierone ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
preStart =
|
||||||
|
''
|
||||||
|
mkdir -p /var/lib/zerotier-one
|
||||||
|
chmod 700 /var/lib/zerotier-one
|
||||||
|
chown -R root:root /var/lib/zerotier-one
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "forking";
|
||||||
|
User = "root";
|
||||||
|
PIDFile = "/var/lib/zerotier-one/zerotier-one.pid";
|
||||||
|
ExecStart = "${pkgs.zerotierone}/bin/zerotier-one -d";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.systemPackages = [ pkgs.zerotierone ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue