mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
Add documentation for unbound configs
This commit is contained in:
@@ -386,8 +386,10 @@ To install hosts file on your machine add the following into your
|
|||||||
|
|
||||||
### Nix Flake
|
### Nix Flake
|
||||||
|
|
||||||
NixOS installations which are managed through _flakes_ can use the hosts file
|
NixOS installations which are managed through _flakes_ can directly use the `flake.nix` in this repository as an input.
|
||||||
like this:
|
|
||||||
|
It contains a `nixosModule` that can be used to install the `hosts` file locally, as well as a package containing config files for the [Unbound](https://github.com/NLnetLabs/unbound) DNS server to be used as blocklists.
|
||||||
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
@@ -403,7 +405,9 @@ like this:
|
|||||||
nixosConfigurations.my-hostname = {
|
nixosConfigurations.my-hostname = {
|
||||||
system = "<architecture>";
|
system = "<architecture>";
|
||||||
modules = [
|
modules = [
|
||||||
hosts.nixosModule {
|
# nixosModule to install hosts file locally:
|
||||||
|
hosts.nixosModule
|
||||||
|
{
|
||||||
networking.stevenBlackHosts = {
|
networking.stevenBlackHosts = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# optionally:
|
# optionally:
|
||||||
@@ -414,6 +418,19 @@ like this:
|
|||||||
# blockSocial = true;
|
# blockSocial = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# configure unbound to use config as blocklist:
|
||||||
|
{
|
||||||
|
{
|
||||||
|
services.unbound = {
|
||||||
|
enable = true;
|
||||||
|
settings.server.include = [
|
||||||
|
"${hosts.packages.${system}.unbound}/hosts"
|
||||||
|
# alternates are also available, e.g. /fakenews, /fakenews-gambling etc.
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user