From f8cc47614f4365372b273aaf45142c307c88af33 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 24 Apr 2026 18:56:10 -0500 Subject: [PATCH] chore: remove unused genesis config bits --- hosts/unstable/genesis/default.nix | 51 +-------------------------- hosts/unstable/genesis/networking.nix | 33 ++++++++--------- modules/nixos/adblock-update.nix | 35 ++++++++++++++++++ modules/nixos/default.nix | 1 + pkgs/adblock_update.nix | 25 +++++++++++++ pkgs/default.nix | 1 + 6 files changed, 77 insertions(+), 69 deletions(-) create mode 100644 modules/nixos/adblock-update.nix create mode 100644 pkgs/adblock_update.nix diff --git a/hosts/unstable/genesis/default.nix b/hosts/unstable/genesis/default.nix index 767d156..9d73ce1 100644 --- a/hosts/unstable/genesis/default.nix +++ b/hosts/unstable/genesis/default.nix @@ -2,29 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ lib, pkgs, ... }: - -let - adblockUpdate = pkgs.writeShellApplication { - name = "adblock-update"; - runtimeInputs = with pkgs; [ - curl - gnused - systemd - ]; - text = '' - curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | sed '1,33d' > /etc/adblock_hosts - curl -s https://adaway.org/hosts.txt | sed '1,24d' | sed 's/127.0.0.1/0.0.0.0/' >> /etc/adblock_hosts - - # Custom domains that I need to preserve for some reason - for f in "segment.com" "segment.io" "branch.io" "dev.visualwebsiteoptimizer.com" "click.discord.com"; do - sed -i -e "/''${f}/d" /etc/adblock_hosts # Blocks Trelly content for house investors - done - - systemctl restart dnsmasq - ''; - }; -in +{ pkgs, ... }: { imports = [ # Include the results of the hardware scan. @@ -35,15 +13,6 @@ in greg = { home = true; gnome.enable = false; - nebula = { - enable = true; - # genesis IS the routing node for the home LAN — it does not route through itself. - # Override the module default (which points at genesis) to avoid a routing loop. - unsafeRoutes = [ ]; - # genesis routes the home LAN (10.42.0.0/16) into the Nebula overlay. - # Sign genesis's cert with -subnets '10.42.0.0/16' (see secrets/nebula/README.md). - routesSubnet = "10.42.0.0/16"; - }; proxies = { }; }; @@ -66,22 +35,4 @@ in ]; networking.hostName = "genesis"; # Define your hostname. - - systemd = { - services.adblock-update = { - after = [ "network-online.target" ]; - requires = [ "network-online.target" ]; - script = lib.getExe adblockUpdate; - serviceConfig.Type = "oneshot"; - }; - timers.adblock-update = { - wantedBy = [ "multi-user.target" ]; - after = [ "network-online.target" ]; - requires = [ "network-online.target" ]; - timerConfig = { - OnCalendar = "daily"; - Unit = "adblock-update.service"; - }; - }; - }; } diff --git a/hosts/unstable/genesis/networking.nix b/hosts/unstable/genesis/networking.nix index 04ea97e..3af062d 100644 --- a/hosts/unstable/genesis/networking.nix +++ b/hosts/unstable/genesis/networking.nix @@ -25,9 +25,20 @@ let ]; in { - greg.tailscale = { - enable = true; - tags = [ "home" ]; + greg = { + nebula = { + enable = true; + # genesis IS the routing node for the home LAN — it does not route through itself. + # Override the module default (which points at genesis) to avoid a routing loop. + unsafeRoutes = [ ]; + # genesis routes the home LAN (10.42.0.0/16) into the Nebula overlay. + # Sign genesis's cert with -subnets '10.42.0.0/16' (see secrets/nebula/README.md). + routesSubnet = "10.42.0.0/16"; + }; + tailscale = { + enable = true; + tags = [ "home" ]; + }; }; # Really, why do I still have to force-disable this crap? @@ -122,22 +133,6 @@ in lan = "lan"; }; }; - - prometheus.exporters = { - dnsmasq.enable = true; - blackbox = { - enable = true; - openFirewall = true; - configFile = pkgs.writeText "blackbox.yml" '' - modules: - icmp: - prober: icmp - timeout: 5s - icmp: - preferred_ip_protocol: ip4 - ''; - }; - }; }; # End of services configuration environment.systemPackages = with pkgs; [ diff --git a/modules/nixos/adblock-update.nix b/modules/nixos/adblock-update.nix new file mode 100644 index 0000000..e6239ee --- /dev/null +++ b/modules/nixos/adblock-update.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.greg.adblockUpdate; +in +{ + + options.greg.adblockUpdate = { + enable = lib.mkEnableOption "Enable auto-update of block list"; + }; + + config = lib.mkIf cfg.enable { + systemd = { + services.adblock-update = { + after = [ "network-online.target" ]; + requires = [ "network-online.target" ]; + script = lib.getExe pkgs.adblockUpdate; + serviceConfig.Type = "oneshot"; + }; + timers.adblock-update = { + wantedBy = [ "multi-user.target" ]; + after = [ "network-online.target" ]; + requires = [ "network-online.target" ]; + timerConfig = { + OnCalendar = "daily"; + Unit = "adblock-update.service"; + }; + }; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index f13915b..47a9ebd 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -4,6 +4,7 @@ { imports = [ + ./adblock-update.nix ./albyhub.nix ./backup.nix ./ceph.nix diff --git a/pkgs/adblock_update.nix b/pkgs/adblock_update.nix new file mode 100644 index 0000000..aec843c --- /dev/null +++ b/pkgs/adblock_update.nix @@ -0,0 +1,25 @@ +{ + writeShellApplication, + curl, + gnused, + systemd, +}: +writeShellApplication { + name = "adblock-update"; + runtimeInputs = [ + curl + gnused + systemd + ]; + text = '' + curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | sed '1,33d' > /etc/adblock_hosts + curl -s https://adaway.org/hosts.txt | sed '1,24d' | sed 's/127.0.0.1/0.0.0.0/' >> /etc/adblock_hosts + + # Custom domains that I need to preserve for some reason + for f in "segment.com" "segment.io" "branch.io" "dev.visualwebsiteoptimizer.com" "click.discord.com"; do + sed -i -e "/''${f}/d" /etc/adblock_hosts # Blocks Trelly content for house investors + done + + systemctl restart dnsmasq + ''; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 8a824a9..eb77023 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -12,6 +12,7 @@ in #iso = top.self.nixosConfigurations.iso.config.system.build.isoImage; #iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage; aacs = c ./aacs.nix { }; + adblock_update = c ./adblock_update.nix { }; brew = c ./homebrew.nix { }; create_ssl = c ./create_ssl.nix { }; gcc-tune = c ./gcc-tune.nix { };