pihole: working maybe

This commit is contained in:
41666 2024-05-31 01:42:23 -04:00
parent c565ac16ba
commit dc13df9795
3 changed files with 75 additions and 39 deletions

43
flake.lock generated
View file

@ -42,7 +42,7 @@
}, },
"devshell": { "devshell": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
"nixpkgs" "nixpkgs"
@ -243,11 +243,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1701680307, "lastModified": 1710146030,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -261,11 +261,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1701680307,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -431,7 +431,6 @@
"linger": { "linger": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
"pihole",
"flake-utils" "flake-utils"
] ]
}, },
@ -719,24 +718,28 @@
}, },
"pihole": { "pihole": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": [
"linger": "linger", "flake-utils"
],
"linger": [
"linger"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs-unstable" "nixpkgs-unstable"
] ]
}, },
"locked": { "locked": {
"lastModified": 1670284048, "lastModified": 1717134073,
"narHash": "sha256-lNyJ7vrDAdsPVcNBXqDUXseBBL9Kf2q64/A8ntEKXWI=", "narHash": "sha256-GTYbZ1H6/PVoMsq4abvxFvZ8K3YcQcYNTVy5Y9d2yUc=",
"owner": "mindsbackyard", "ref": "refs/heads/main",
"repo": "pihole-flake", "rev": "a125ee3d1cd490c5a4ace180017c149c3c10e04b",
"rev": "9daaf65415ad6d3f5a8daa617d8737bc405f9dd8", "revCount": 38,
"type": "github" "type": "git",
"url": "https://git.sapphic.engineer/noe/pihole-flake"
}, },
"original": { "original": {
"owner": "mindsbackyard", "type": "git",
"repo": "pihole-flake", "url": "https://git.sapphic.engineer/noe/pihole-flake"
"type": "github"
} }
}, },
"root": { "root": {
@ -745,10 +748,12 @@
"darwin": "darwin", "darwin": "darwin",
"doll-repair": "doll-repair", "doll-repair": "doll-repair",
"fedi-emotes": "fedi-emotes", "fedi-emotes": "fedi-emotes",
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"iceshrimp": "iceshrimp", "iceshrimp": "iceshrimp",
"iceshrimp-withdrawal": "iceshrimp-withdrawal", "iceshrimp-withdrawal": "iceshrimp-withdrawal",
"lightrunner-emotes": "lightrunner-emotes", "lightrunner-emotes": "lightrunner-emotes",
"linger": "linger",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",

View file

@ -33,6 +33,7 @@
# Pro gamer move # Pro gamer move
nixos-generators.url = "github:nix-community/nixos-generators"; nixos-generators.url = "github:nix-community/nixos-generators";
flake-utils.url = "github:numtide/flake-utils";
# Iceshrimpy # Iceshrimpy
iceshrimp = { iceshrimp = {
@ -47,8 +48,14 @@
# PiHole # PiHole
pihole = { pihole = {
url = "github:mindsbackyard/pihole-flake"; url = "git+https://git.sapphic.engineer/noe/pihole-flake";
inputs.nixpkgs.follows = "nixpkgs-unstable"; inputs.nixpkgs.follows = "nixpkgs-unstable";
inputs.linger.follows = "linger";
inputs.flake-utils.follows = "flake-utils";
};
linger = {
url = "github:mindsbackyard/linger-flake";
inputs.flake-utils.follows = "flake-utils";
}; };
# Self # Self

View file

@ -3,19 +3,41 @@
../../templates/proxmox-lxc.nix ../../templates/proxmox-lxc.nix
../../server.nix ../../server.nix
../../features/dns-cache.nix ../../features/dns-cache.nix
inputs.pihole.nixosModules.default inputs.linger.nixosModules.x86_64-linux.default
inputs.pihole.nixosModules.x86_64-linux.default
]; ];
networking.hostName = "pihole"; networking.hostName = "pihole";
system.stateVersion = "24.11"; system.stateVersion = "24.11";
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
boot.tmp.cleanOnBoot = lib.mkForce true;
networking.firewall = {
allowedTCPPorts = [
config.services.pihole.hostConfig.dnsPort
config.services.pihole.hostConfig.webPort
];
allowedUDPPorts = [
config.services.pihole.hostConfig.dnsPort
];
};
users.users.pihole = {
isNormalUser = true;
subUidRanges = [{ count = 65534; startUid = 100001; }];
subGidRanges = [{ count = 65534; startGid = 100001; }];
};
services.pihole = { services.pihole = {
enable = true; enable = true;
hostConfig = {
user = "pihole";
enableLingeringForUser = true; enableLingeringForUser = true;
persistVolumes = true; persistVolumes = true;
dnsPort = 5353; dnsPort = 5353;
webPort = 8080; webPort = 8080;
};
piholeConfig = {
web = { web = {
password = "abcd1234"; # todo? password = "abcd1234"; # todo?
virtualHost = "http://pihole.hoki-porgy.ts.net"; virtualHost = "http://pihole.hoki-porgy.ts.net";
@ -31,6 +53,8 @@
bogusPriv = true; bogusPriv = true;
fqdnRequired = true; fqdnRequired = true;
}; };
}; };
};
} }