mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
Add netbird module
This commit is contained in:
parent
ef0e7f41cd
commit
09a45c8458
2 changed files with 36 additions and 0 deletions
|
@ -53,6 +53,7 @@
|
|||
./services/mail/offlineimap.nix
|
||||
./services/mopidy.nix
|
||||
./services/monitoring/telegraf.nix
|
||||
./services/netbird.nix
|
||||
./services/nix-daemon.nix
|
||||
./services/nix-gc
|
||||
./services/ofborg
|
||||
|
|
35
modules/services/netbird.nix
Normal file
35
modules/services/netbird.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.netbird;
|
||||
in
|
||||
{
|
||||
options.services.netbird = {
|
||||
enable = mkEnableOption "Netbird daemon";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.netbird;
|
||||
defaultText = literalExpression "pkgs.netbird";
|
||||
description = "The package to use for netbird";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
launchd.daemons.netbird = {
|
||||
script = ''
|
||||
mkdir -p /var/run/netbird /var/lib/netbird
|
||||
exec ${cfg.package}/bin/netbird service run
|
||||
'';
|
||||
serviceConfig = {
|
||||
EnvironmentVariables = {
|
||||
NB_CONFIG = "/var/lib/netbird/config.json";
|
||||
NB_LOG_FILE = "console";
|
||||
};
|
||||
KeepAlive = true;
|
||||
RunAtLoad = true;
|
||||
StandardOutPath = "/var/log/netbird.out.log";
|
||||
StandardErrorPath = "/var/log/netbird.err.log";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue