depot/third_party/nixpkgs/nixos/modules/config/stevenblack.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

49 lines
853 B
Nix

{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
getOutput
maintainers
mkEnableOption
mkIf
mkOption
mkPackageOption
types
;
cfg = config.networking.stevenblack;
in
{
options.networking.stevenblack = {
enable = mkEnableOption "the stevenblack hosts file blocklist";
package = mkPackageOption pkgs "stevenblack-blocklist" { };
block = mkOption {
type = types.listOf (
types.enum [
"fakenews"
"gambling"
"porn"
"social"
]
);
default = [ ];
description = "Additional blocklist extensions.";
};
};
config = mkIf cfg.enable {
networking.hostFiles = map (x: "${getOutput x cfg.package}/hosts") ([ "ads" ] ++ cfg.block);
};
meta.maintainers = with maintainers; [
moni
artturin
frontear
];
}