summaryrefslogtreecommitdiff
path: root/tests/services-privoxy.nix
blob: f6c16a423b8097105f2c805297aa03be94ecd28d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ config, lib, pkgs, ... }:

with lib;

let
  privoxy = pkgs.runCommand "privoxy-0.0.0" {} "mkdir $out";
in

{
  services.privoxy.enable = true;
  services.privoxy.package = privoxy;
  services.privoxy.config = "forward / .";

  test = ''
    echo >&2 "checking privoxy service in ~/Library/LaunchAgents"
    grep "org.nixos.privoxy" ${config.out}/user/Library/LaunchAgents/org.nixos.privoxy.plist
    echo grep "${privoxy}/bin/privoxy" ${config.out}/user/Library/LaunchAgents/org.nixos.privoxy.plist
    grep "${privoxy}/bin/privoxy" ${config.out}/user/Library/LaunchAgents/org.nixos.privoxy.plist

    echo >&2 "checking config in /etc/privoxy-config"
    grep "forward / ." ${config.out}/etc/privoxy-config
  '';
}