From d76c5a25a25b502cce8aeb984b9d022092591233 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 3 Dec 2023 02:24:11 -0500 Subject: [PATCH] feat(oksys): start pihole config --- devices/oksys/default.nix | 3 ++ devices/oksys/modules/pihole.nix | 22 ++++++++++ flake.lock | 75 ++++++++++++++++++++------------ flake.nix | 16 ++++++- 4 files changed, 87 insertions(+), 29 deletions(-) create mode 100644 devices/oksys/modules/pihole.nix diff --git a/devices/oksys/default.nix b/devices/oksys/default.nix index 397d9d5..9d17a40 100644 --- a/devices/oksys/default.nix +++ b/devices/oksys/default.nix @@ -4,7 +4,10 @@ ../../modules/tailscale.nix + ./modules/caddy.nix ./modules/headscale.nix + ./modules/pihole.nix + ./modules/unbound.nix ]; vars = { diff --git a/devices/oksys/modules/pihole.nix b/devices/oksys/modules/pihole.nix new file mode 100644 index 0000000..6d7d3a3 --- /dev/null +++ b/devices/oksys/modules/pihole.nix @@ -0,0 +1,22 @@ +{pihole, ...}: { + imports = [pihole.nixosModules.default]; + + #TODO: set the whole thing up + services.pihole = { + enable = true; + + dnsPort = 5335; + webPort = 8080; + + piholeConfig = { + ftl = { + LOCAL_IPV4 = "127.0.0.1"; + }; + + web = { + virtualHost = "pi.hole"; + password = "password"; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index cdc83ea..25222e9 100644 --- a/flake.lock +++ b/flake.lock @@ -139,11 +139,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1698882062, - "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "type": "github" }, "original": { @@ -215,11 +215,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -426,11 +426,11 @@ ] }, "locked": { - "lastModified": 1701475484, - "narHash": "sha256-Zg0SnZBAkiWOEu1fymQPdjLFigrSwHHq7WZmtb9Gowk=", + "lastModified": 1701561877, + "narHash": "sha256-CoN1OfLWTqJuVY8vhEVtOIfh9tKmD7kVJMR12eN8oy0=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "9575e3b4d35e88acacaf8493a2a28e2a71516cb9", + "rev": "21fd12540f35e372ff59d126ce0e3360cd44d7eb", "type": "github" }, "original": { @@ -449,11 +449,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1701474944, - "narHash": "sha256-24/lpcDjoVrNHcPzs1JfQpxZxl6/FaGCJ3VrPN3BHco=", + "lastModified": 1701540140, + "narHash": "sha256-STWB5LiEQzDbEtyCF4ISjD13+7cWEFErYK8mEmuQSHQ=", "owner": "neovim", "repo": "neovim", - "rev": "f6e5366d0077e9f171651f37282cb5c47629d1b6", + "rev": "481a3158866638946c91fab28ae5bca97ff1e814", "type": "github" }, "original": { @@ -508,11 +508,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1701479652, - "narHash": "sha256-j1VN+ie5pAMTDyWyfClVAV0InQwN10emYjODpje2hGc=", + "lastModified": 1701566078, + "narHash": "sha256-PZWUId79Z/2wJiPNwJuiHROxZ9MgTEBJ3GXXV93TbJo=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "b8f0f720bd51494c24f62a5f97d2ea397cbba43a", + "rev": "2bf2652ddb2bc078de3a2cdae01448bf5ae0773d", "type": "github" }, "original": { @@ -550,11 +550,11 @@ ] }, "locked": { - "lastModified": 1700968077, - "narHash": "sha256-Lax+2g7G3Fe+ckMrHLYTl+97unbmNDmN1qS9MLBkxr4=", + "lastModified": 1701572887, + "narHash": "sha256-oCPwQZT0Inis4zcYhtFHUp7Rym1zglKPLDcRird35q8=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "bd3aec0ecb0fdde863a7ed2c6caa220c47e22c07", + "rev": "41afa8d1c061beda68502bcc67f2788f3a77042b", "type": "github" }, "original": { @@ -600,11 +600,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1698611440, - "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", "type": "github" }, "original": { @@ -653,11 +653,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1700856099, - "narHash": "sha256-RnEA7iJ36Ay9jI0WwP+/y4zjEhmeN6Cjs9VOFBH7eVQ=", + "lastModified": 1701336116, + "narHash": "sha256-kEmpezCR/FpITc6yMbAh4WrOCiT2zg5pSjnKrq51h5Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0bd59c54ef06bc34eca01e37d689f5e46b3fe2f1", + "rev": "f5c27c6136db4d76c30e533c20517df6864c46ee", "type": "github" }, "original": { @@ -749,11 +749,11 @@ }, "nur": { "locked": { - "lastModified": 1701542727, - "narHash": "sha256-SdihBXvt94ArmFSsNEZYO/BtHz9laN2YTyNI723W3p4=", + "lastModified": 1701584668, + "narHash": "sha256-F7uYa1WHgifZ6uzO65Zkoh8decAKcSxgmllBNjjLPFk=", "owner": "nix-community", "repo": "NUR", - "rev": "2cd6706becb7fc6a52f755836bbbd2ef181deea8", + "rev": "e2c94e7b39f3b9f4f82310a8c4168c886d7bd204", "type": "github" }, "original": { @@ -780,6 +780,26 @@ "type": "github" } }, + "pihole": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701587053, + "narHash": "sha256-Krd8ct+fLrG7crOyPJajT5o7gQEzj9ycBsPUxi3l+rk=", + "owner": "matt1432", + "repo": "pihole-flake", + "rev": "5e96597d9eb88647f14cb8bc65aa9eb02bd3bcee", + "type": "github" + }, + "original": { + "owner": "matt1432", + "repo": "pihole-flake", + "type": "github" + } + }, "root": { "inputs": { "ags": "ags", @@ -798,6 +818,7 @@ "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", "nurl": "nurl", + "pihole": "pihole", "tree-sitter-hypr-flake": "tree-sitter-hypr-flake" } }, diff --git a/flake.nix b/flake.nix index bc8f6ac..81495b4 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,14 @@ nixpkgs, ... } @ attrs: let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); + defaultModules = [ home-manager.nixosModules.home-manager { @@ -33,8 +41,7 @@ }; }; - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; - formatter.aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.alejandra; + formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra); }; inputs = { @@ -50,6 +57,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + # Oksys flakes headscale = { url = "github:juanfont/headscale"; inputs.nixpkgs.follows = "nixpkgs"; @@ -58,6 +66,10 @@ url = "github:matt1432/nixos-caddy-patched"; inputs.nixpkgs.follows = "nixpkgs"; }; + pihole = { + url = "github:matt1432/pihole-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; hyprland = { url = "github:hyprwm/Hyprland";