feat: adguard home basic setup
This commit is contained in:
@@ -19,6 +19,13 @@
|
||||
enable = true;
|
||||
flakeDir = "/home/guz/.nix#homex";
|
||||
|
||||
adguard = {
|
||||
enable = true;
|
||||
settings.server = {
|
||||
port = 3010;
|
||||
};
|
||||
};
|
||||
|
||||
forgejo = {
|
||||
enable = true;
|
||||
settings.users."user1" = {
|
||||
@@ -27,6 +34,9 @@
|
||||
password = /. + config.sops.secrets."forgejo/user1/password".path;
|
||||
admin = true;
|
||||
};
|
||||
settings.server = {
|
||||
port = 3020;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
46
modules/nixos/homelab/adguard.nix
Normal file
46
modules/nixos/homelab/adguard.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homelab.adguard;
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
options.homelab.adguard = with lib; with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
extraArgs = mkOption {
|
||||
type = listOf str;
|
||||
default = [ ];
|
||||
};
|
||||
settings = {
|
||||
server.domain = mkOption {
|
||||
type = str;
|
||||
default = "localhost";
|
||||
};
|
||||
server.port = mkOption {
|
||||
type = port;
|
||||
default = 3000;
|
||||
};
|
||||
server.address = mkOption {
|
||||
type = str;
|
||||
default = "0.0.0.0";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 53 ];
|
||||
allowedUDPPorts = [ 53 51820 ];
|
||||
};
|
||||
services.adguardhome = {
|
||||
enable = true;
|
||||
settings = {
|
||||
bind_port = cfg.settings.server.port;
|
||||
bind_host = cfg.settings.server.address;
|
||||
http = {
|
||||
address = "${cfg.settings.server.address}:${toString cfg.settings.server.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ in
|
||||
{
|
||||
imports = [
|
||||
./forgejo.nix
|
||||
./adguard.nix
|
||||
];
|
||||
options.homelab = with lib; with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
|
||||
Reference in New Issue
Block a user