system/modules/nixos/programs/browsers/tor-browser.nix

21 lines
609 B
Nix

{ pkgs, lib, ... }:
let
policiesJson = pkgs.callPackage ./policies.nix { };
torBrowser = (pkgs.tor-browser-bundle-bin.override {
mediaSupport = true;
pulseaudioSupport = true;
}).overrideAttrs (attrs: {
postInstall = ''
rm $out/share/tor-browser/distribution/policies.json
install -Dvm644 ${policiesJson} $out/share/tor-browser/distribution/policies.json
'';
});
in
{
options.local.programs.browsers.tor-browser = with lib; {
enable = mkEnableOption "tor-browser";
package = mkPackageOption pkgs "tor-browser-bundle-bin" {} // { default = torBrowser; };
};
}