1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-09-11 12:49:18 +03:00

Merge pull request #247 from happysalada/fix_nextdns

nextdns: add to modulelist
This commit is contained in:
Daiderd Jordan 2020-12-06 15:21:49 +01:00 committed by GitHub
commit 57df59ea2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 4 deletions

View File

@ -57,6 +57,7 @@
./services/synapse-bt.nix
./services/synergy
./services/yabai
./services/nextdns
./programs/bash
./programs/fish.nix
./programs/gnupg.nix

View File

@ -30,10 +30,8 @@ in {
launchd.daemons.nextdns = {
path = [ nextdns ];
script = ''
"${pkgs.nextdns}/bin/nextdns run ${escapeShellArgs cfg.arguments}";
'';
serviceConfig.ProgramArguments =
[ "${pkgs.nextdns}/bin/nextdns" "run" (escapeShellArgs cfg.arguments) ];
serviceConfig.KeepAlive = true;
serviceConfig.RunAtLoad = true;
};

View File

@ -118,6 +118,7 @@ let
tests.sockets-nix-daemon = makeTest ./tests/sockets-nix-daemon.nix;
tests.services-dnsmasq = makeTest ./tests/services-dnsmasq.nix;
tests.services-nix-gc = makeTest ./tests/services-nix-gc.nix;
tests.services-nextdns = makeTest ./tests/services-nextdns.nix;
tests.services-ofborg = makeTest ./tests/services-ofborg.nix;
tests.services-offlineimap = makeTest ./tests/services-offlineimap.nix;
tests.services-privoxy = makeTest ./tests/services-privoxy.nix;

View File

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
with lib;
let nextdns = pkgs.runCommand "nextdns-0.0.0" { } "mkdir $out";
in {
services.nextdns.enable = true;
services.nextdns.arguments = [ "-config" "10.0.3.0/24=abcdef" ];
test = ''
echo >&2 "checking nextdns service in ~/Library/LaunchDaemons"
grep "org.nixos.nextdns" ${config.out}/Library/LaunchDaemons/org.nixos.nextdns.plist
grep "/bin/nextdns" ${config.out}/Library/LaunchDaemons/org.nixos.nextdns.plist
grep "'-config' '10.0.3.0/24=abcdef'" ${config.out}/Library/LaunchDaemons/org.nixos.nextdns.plist
'';
}