f34ce41345
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
49 lines
853 B
Nix
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
|
|
];
|
|
}
|