pihole: added to nameserver
This commit is contained in:
parent
baccbeb7d0
commit
86f7b971bb
|
@ -23,19 +23,21 @@ in
|
||||||
sopsFile = ../../secrets/pihole.yaml;
|
sopsFile = ../../secrets/pihole.yaml;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.nameservers = [ piholeDNSIPBind ];
|
||||||
|
|
||||||
systemd.services.create-kavita-network = {
|
|
||||||
|
systemd.services."create-${name}-network" = {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
};
|
};
|
||||||
wantedBy = [ "podman-pihole.service" ];
|
wantedBy = [ "podman-${name}.service" ];
|
||||||
script = ''${pkgs.podman}/bin/podman network exists ${name} || ${pkgs.podman}/bin/podman network create --gateway=${gateway} --subnet=${subnet} --ip-range=${ip-range} ${name}'';
|
script = ''${pkgs.podman}/bin/podman network exists ${name} || ${pkgs.podman}/bin/podman network create --gateway=${gateway} --subnet=${subnet} --ip-range=${ip-range} ${name}'';
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."pihole/custom.list" = {
|
environment.etc."pihole/custom.list" = {
|
||||||
# Copy file instead of symlink
|
# Copy file instead of symlink
|
||||||
mode = "0400";
|
mode = "0444";
|
||||||
|
|
||||||
# Creates a pihole custom.list file with the following pattern:
|
# Creates a pihole custom.list file with the following pattern:
|
||||||
#
|
#
|
||||||
|
@ -53,7 +55,7 @@ in
|
||||||
)}
|
)}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
virtualisation.oci-containers.containers.pihole = {
|
virtualisation.oci-containers.containers.${name} = {
|
||||||
inherit image;
|
inherit image;
|
||||||
environment = {
|
environment = {
|
||||||
TZ = "Asia/Jakarta";
|
TZ = "Asia/Jakarta";
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.profile.services.stubby;
|
cfg = config.profile.services.stubby;
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf lists;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
networking.resolvconf.useLocalResolver = false;
|
networking.resolvconf.useLocalResolver = false;
|
||||||
networking.nameservers = [ "192.168.100.5" ];
|
networking.nameservers = lists.optional (!config.profile.podman.pihole.enable) "192.168.100.5";
|
||||||
services.stubby = {
|
services.stubby = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = pkgs.stubby.passthru.settingsExample // {
|
settings = pkgs.stubby.passthru.settingsExample // {
|
||||||
|
|
Loading…
Reference in a new issue