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

29 lines
751 B
Nix
Raw Normal View History

{ config, pkgs, lib, ... }:
2024-04-16 02:51:46 +03:00
let
cfg = config.local.programs.browsers.tor-browser;
2024-04-18 18:18:53 +03:00
policiesJson = pkgs.callPackage ./policies.nix { };
2024-04-16 02:51:46 +03:00
finalTorBrowser = (cfg.package.override {
2024-04-16 02:51:46 +03:00
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" {};
finalPackage = mkOption {
type = types.package;
readOnly = true;
default = finalTorBrowser;
};
2024-04-16 02:51:46 +03:00
};
}