feat: add filters and rewrites to adguardhome

This commit is contained in:
oddlama 2024-01-11 20:17:31 +01:00
parent a44f73d3b0
commit 8876f3076e
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 74 additions and 48 deletions

View file

@ -75,6 +75,7 @@ Server related stuff:
If you are interested in parts of my configuration, If you are interested in parts of my configuration,
you probably want to examine the contents of `users/`, `modules/` and `hosts/`. you probably want to examine the contents of `users/`, `modules/` and `hosts/`.
Also, a lot of interesting modules have been moved to [nixos-extra-modules](https://github.com/oddlama/nixos-extra-modules), a separate repository specifically for reusable stuff.
The full structure of this flake is described in [STRUCTURE.md](./STRUCTURE.md), The full structure of this flake is described in [STRUCTURE.md](./STRUCTURE.md),
but here's a quick breakdown of the what you will find where. but here's a quick breakdown of the what you will find where.

66
flake.lock generated
View file

@ -331,10 +331,10 @@
"devshell_3": { "devshell_3": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"extra-modules", "nixos-extra-modules",
"nixpkgs" "nixpkgs"
], ],
"systems": "systems_6" "systems": "systems_7"
}, },
"locked": { "locked": {
"lastModified": 1701787589, "lastModified": 1701787589,
@ -394,32 +394,6 @@
"type": "github" "type": "github"
} }
}, },
"extra-modules": {
"inputs": {
"devshell": "devshell_3",
"flake-utils": [
"flake-utils"
],
"lib-net": "lib-net",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks_3"
},
"locked": {
"lastModified": 1704938286,
"narHash": "sha256-/uv+N2v5ixqYz7SG8R5GWOTdrNKboHEp85BR5Jdz6qE=",
"owner": "oddlama",
"repo": "nixos-extra-modules",
"rev": "c55f465ba1f369852ab4122a9fa42c85b4a571de",
"type": "github"
},
"original": {
"owner": "oddlama",
"repo": "nixos-extra-modules",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -630,7 +604,7 @@
}, },
"flake-utils_4": { "flake-utils_4": {
"inputs": { "inputs": {
"systems": "systems_7" "systems": "systems_6"
}, },
"locked": { "locked": {
"lastModified": 1701680307, "lastModified": 1701680307,
@ -743,7 +717,7 @@
"gitignore_3": { "gitignore_3": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"extra-modules", "nixos-extra-modules",
"pre-commit-hooks", "pre-commit-hooks",
"nixpkgs" "nixpkgs"
] ]
@ -994,6 +968,32 @@
"type": "github" "type": "github"
} }
}, },
"nixos-extra-modules": {
"inputs": {
"devshell": "devshell_3",
"flake-utils": [
"flake-utils"
],
"lib-net": "lib-net",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks_3"
},
"locked": {
"lastModified": 1704938286,
"narHash": "sha256-/uv+N2v5ixqYz7SG8R5GWOTdrNKboHEp85BR5Jdz6qE=",
"owner": "oddlama",
"repo": "nixos-extra-modules",
"rev": "c55f465ba1f369852ab4122a9fa42c85b4a571de",
"type": "github"
},
"original": {
"owner": "oddlama",
"repo": "nixos-extra-modules",
"type": "github"
}
},
"nixos-generators": { "nixos-generators": {
"inputs": { "inputs": {
"nixlib": "nixlib", "nixlib": "nixlib",
@ -1271,12 +1271,12 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": "flake-compat_4",
"flake-utils": [ "flake-utils": [
"extra-modules", "nixos-extra-modules",
"flake-utils" "flake-utils"
], ],
"gitignore": "gitignore_3", "gitignore": "gitignore_3",
"nixpkgs": [ "nixpkgs": [
"extra-modules", "nixos-extra-modules",
"nixpkgs" "nixpkgs"
], ],
"nixpkgs-stable": "nixpkgs-stable_3" "nixpkgs-stable": "nixpkgs-stable_3"
@ -1328,12 +1328,12 @@
"devshell": "devshell_2", "devshell": "devshell_2",
"disko": "disko", "disko": "disko",
"elewrap": "elewrap", "elewrap": "elewrap",
"extra-modules": "extra-modules",
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_4",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"microvm": "microvm", "microvm": "microvm",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixos-extra-modules": "nixos-extra-modules",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixos-nftables-firewall": "nixos-nftables-firewall", "nixos-nftables-firewall": "nixos-nftables-firewall",

View file

@ -29,12 +29,6 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
extra-modules = {
url = "github:oddlama/nixos-extra-modules";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
home-manager = { home-manager = {
@ -44,11 +38,23 @@
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
microvm = {
url = "github:astro/microvm.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
nix-index-database = { nix-index-database = {
url = "github:Mic92/nix-index-database"; url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-extra-modules = {
url = "github:oddlama/nixos-extra-modules";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
nixos-hardware.url = "github:NixOS/nixos-hardware"; nixos-hardware.url = "github:NixOS/nixos-hardware";
nixos-generators = { nixos-generators = {
@ -74,12 +80,6 @@
inputs.pre-commit-hooks.follows = "pre-commit-hooks"; inputs.pre-commit-hooks.follows = "pre-commit-hooks";
}; };
microvm = {
url = "github:astro/microvm.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
pre-commit-hooks = { pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix"; url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -104,7 +104,7 @@
self, self,
agenix-rekey, agenix-rekey,
devshell, devshell,
extra-modules, nixos-extra-modules,
flake-utils, flake-utils,
nixos-generators, nixos-generators,
nixpkgs, nixpkgs,
@ -167,7 +167,7 @@
import ./lib inputs import ./lib inputs
++ import ./pkgs/default.nix ++ import ./pkgs/default.nix
++ [ ++ [
extra-modules.overlays.default nixos-extra-modules.overlays.default
devshell.overlays.default devshell.overlays.default
agenix-rekey.overlays.default agenix-rekey.overlays.default
]; ];

View file

@ -77,6 +77,31 @@ in {
"2001:4860:4860::8844" "2001:4860:4860::8844"
]; ];
dhcp.enabled = false; dhcp.enabled = false;
# Undo the /etc/hosts entry so we don't answer with the internal
# wireguard address for influxdb
rewrites = [
{
domain = sentinelCfg.networking.providedDomains.influxdb;
answer = sentinelCfg.repo.secrets.local.personalDomain;
}
];
filters = [
{
name = "AdGuard DNS filter";
url = "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt";
enabled = true;
}
{
name = "AdaAway Default Blocklist";
url = "https://adaway.org/hosts.txt";
enabled = true;
}
{
name = "OISD (Big)";
url = "https://big.oisd.nl";
enabled = true;
}
];
}; };
}; };
}; };

View file

@ -5,7 +5,7 @@
inputs.agenix.nixosModules.default inputs.agenix.nixosModules.default
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
inputs.elewrap.nixosModules.default inputs.elewrap.nixosModules.default
inputs.extra-modules.nixosModules.default inputs.nixos-extra-modules.nixosModules.default
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
inputs.nixos-nftables-firewall.nixosModules.default inputs.nixos-nftables-firewall.nixosModules.default