mirror of
https://github.com/materusPL/nixos-config
synced 2026-07-02 12:46:42 +00:00
code: nixpkgs-fmt to format code
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports =
|
||||
imports =
|
||||
[
|
||||
./pleroma.nix
|
||||
./pihole.nix
|
||||
];
|
||||
services.adguardhome.enable = true;
|
||||
services.adguardhome.enable = true;
|
||||
|
||||
valkyrieService.pihole.enable = false;
|
||||
valkyrieService.pleroma.enable = true;
|
||||
valkyrieService.pihole.enable = false;
|
||||
valkyrieService.pleroma.enable = true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +1,56 @@
|
||||
{ config, pkgs, lib, materusArg, ... }:
|
||||
{
|
||||
options.valkyrieService.pihole.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable pihole";
|
||||
options.valkyrieService.pihole.dnsIP = lib.mkOption { default = "127.0.0.1";};
|
||||
options.valkyrieService.pihole.webIP = lib.mkOption { default = "127.0.0.1";};
|
||||
options.valkyrieService.pihole.dnsIP = lib.mkOption { default = "127.0.0.1"; };
|
||||
options.valkyrieService.pihole.webIP = lib.mkOption { default = "127.0.0.1"; };
|
||||
|
||||
|
||||
|
||||
config = let
|
||||
cfg = config.valkyrieService.pihole;
|
||||
dnsmasqConf = pkgs.writeText "02-dnsmasq-custom.conf" ''
|
||||
no-hosts
|
||||
'';
|
||||
|
||||
in lib.mkIf config.valkyrieService.pihole.enable {
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/lib/dnsmasq.d 0776 root root -"
|
||||
"d /var/lib/pihole 0776 root root -"
|
||||
"L+ /var/lib/dnsmasq.d/02-dnsmasq-custom.conf 0776 root root - ${dnsmasqConf}"
|
||||
];
|
||||
config =
|
||||
let
|
||||
cfg = config.valkyrieService.pihole;
|
||||
dnsmasqConf = pkgs.writeText "02-dnsmasq-custom.conf" ''
|
||||
no-hosts
|
||||
'';
|
||||
|
||||
virtualisation.oci-containers.containers.pihole = {
|
||||
image = "pihole/pihole:latest";
|
||||
ports =
|
||||
[
|
||||
"${cfg.dnsIP}:53:53/tcp"
|
||||
"${cfg.dnsIP}:53:53/udp"
|
||||
"${cfg.webIP}:3000:80"
|
||||
];
|
||||
environment = {
|
||||
TZ = "Europe/Warsaw";
|
||||
FTLCONF_LOCAL_IPV4="127.0.0.1";
|
||||
DNSMASQ_USER="root";
|
||||
VIRTUAL_HOST="pi.hole";
|
||||
PROXY_LOCATION="pi.hole";
|
||||
};
|
||||
volumes = [
|
||||
"/var/lib/pihole/:/etc/pihole/"
|
||||
"/var/lib/dnsmasq.d:/etc/dnsmasq.d/"
|
||||
"/nix/store:/nix/store"
|
||||
in
|
||||
lib.mkIf config.valkyrieService.pihole.enable {
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/lib/dnsmasq.d 0776 root root -"
|
||||
"d /var/lib/pihole 0776 root root -"
|
||||
"L+ /var/lib/dnsmasq.d/02-dnsmasq-custom.conf 0776 root root - ${dnsmasqConf}"
|
||||
];
|
||||
extraOptions =
|
||||
[
|
||||
"--cap-add=NET_ADMIN"
|
||||
"--dns=127.0.0.1"
|
||||
"--dns=9.9.9.9"
|
||||
"--hostname=pi.hole"
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
virtualisation.oci-containers.containers.pihole = {
|
||||
image = "pihole/pihole:latest";
|
||||
ports =
|
||||
[
|
||||
"${cfg.dnsIP}:53:53/tcp"
|
||||
"${cfg.dnsIP}:53:53/udp"
|
||||
"${cfg.webIP}:3000:80"
|
||||
];
|
||||
environment = {
|
||||
TZ = "Europe/Warsaw";
|
||||
FTLCONF_LOCAL_IPV4 = "127.0.0.1";
|
||||
DNSMASQ_USER = "root";
|
||||
VIRTUAL_HOST = "pi.hole";
|
||||
PROXY_LOCATION = "pi.hole";
|
||||
};
|
||||
volumes = [
|
||||
"/var/lib/pihole/:/etc/pihole/"
|
||||
"/var/lib/dnsmasq.d:/etc/dnsmasq.d/"
|
||||
"/nix/store:/nix/store"
|
||||
];
|
||||
extraOptions =
|
||||
[
|
||||
"--cap-add=NET_ADMIN"
|
||||
"--dns=127.0.0.1"
|
||||
"--dns=9.9.9.9"
|
||||
"--hostname=pi.hole"
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user