This commit is contained in:
2025-08-01 14:03:40 -05:00
parent 116f935389
commit ce27df5933
2 changed files with 18 additions and 6 deletions

View File

@@ -133,7 +133,7 @@
}; };
nix = { nix = {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; nixPath = [ "nixpkgs=${inputs.nixpkgs}" "unstable=${inputs.nixpkgs-us}" ];
settings = { settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
}; };

View File

@@ -1,13 +1,18 @@
{ config, lib, ... }: { { config, lib, inputs, ... }: {
options.sysconfig.opts.virtualization.pihole.enable = lib.options.mkOption { options.sysconfig.opts.virtualization.pihole.enable = lib.options.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;
}; };
imports = [
"${inputs.nixpkgs-us}/nixos/modules/services/networking/pihole-ftl.nix"
"${inputs.nixpkgs-us}/nixos/modules/services/web-apps/pihole-web.nix"
];
config = lib.mkIf config.sysconfig.opts.virtualization.pihole.enable { config = lib.mkIf config.sysconfig.opts.virtualization.pihole.enable {
sops.secrets."pihole/pass" = {}; /* sops.secrets."pihole/pass" = {};
sops.templates."pihole.env" = { sops.templates."pihole.env" = {
content = '' content = ''
@@ -16,7 +21,7 @@
path = "/ssd1/Pihole/.env"; path = "/ssd1/Pihole/.env";
}; };
*/
containers.pihole = { containers.pihole = {
autoStart = true; autoStart = true;
@@ -25,18 +30,23 @@
localAddress = "192.168.100.28"; localAddress = "192.168.100.28";
config = { config = {
networking.firewall.allowedTCPPorts = [ 80 ];
services = { services = let
pkgs-us = import inputs.nixpkgs-us { system = "x86_64-linux"; };
in {
pihole-web = { pihole-web = {
enable = true; enable = true;
package = pkgs-us.pihole-web;
ports = [ "80r" ]; ports = [ "80r" ];
}; };
pihole-ftl = { pihole-ftl = {
enable = true; enable = true;
package = pkgs-us.pihole-ftl;
openFirewallDNS = true; openFirewallDNS = true;
}; };
@@ -45,6 +55,8 @@
}; };
}; };
networking.firewall.allowedTCPPorts = [ 80 ];
system.stateVersion = "24.05"; system.stateVersion = "24.05";
}; };
}; };