mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
Merge pull request #247 from happysalada/fix_nextdns
nextdns: add to modulelist
This commit is contained in:
commit
57df59ea2d
4 changed files with 21 additions and 4 deletions
|
@ -57,6 +57,7 @@
|
|||
./services/synapse-bt.nix
|
||||
./services/synergy
|
||||
./services/yabai
|
||||
./services/nextdns
|
||||
./programs/bash
|
||||
./programs/fish.nix
|
||||
./programs/gnupg.nix
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
17
tests/services-nextdns.nix
Normal file
17
tests/services-nextdns.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue