From 7ec5497cf239ce1182f2d73861f9dd3f1240384c Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 25 Aug 2023 12:18:15 -0500 Subject: [PATCH 1/3] Add buildifier and move lshw --- home/vscodium.nix | 1 + modules-all/default.nix | 1 - modules-linux/default.nix | 4 ++++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/home/vscodium.nix b/home/vscodium.nix index a828006..5dea5b8 100644 --- a/home/vscodium.nix +++ b/home/vscodium.nix @@ -2,6 +2,7 @@ { home.packages = with pkgs; [ + buildifier gopls ]; diff --git a/modules-all/default.nix b/modules-all/default.nix index 46b9f93..3871f4c 100644 --- a/modules-all/default.nix +++ b/modules-all/default.nix @@ -60,7 +60,6 @@ hms # My own home manager switcher htop killall - lshw nano pciutils pwgen diff --git a/modules-linux/default.nix b/modules-linux/default.nix index e3b05b8..c90c688 100644 --- a/modules-linux/default.nix +++ b/modules-linux/default.nix @@ -15,6 +15,10 @@ ./tailscale.nix ]; + environment.systemPackages = [ + lshw + ]; + system.stateVersion = "22.05"; nix.gc.dates = "weekly"; From a71d945ba348b5b5179fb9bc3a9f5148ceb51076 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 25 Aug 2023 15:49:33 -0500 Subject: [PATCH 2/3] Add some exceptions to adblock filtering --- hosts/genesis/adblockUpdate.sh | 11 +++++++++++ hosts/genesis/dnsmasq.nix | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 hosts/genesis/adblockUpdate.sh diff --git a/hosts/genesis/adblockUpdate.sh b/hosts/genesis/adblockUpdate.sh new file mode 100644 index 0000000..1f60fa8 --- /dev/null +++ b/hosts/genesis/adblockUpdate.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -ex + + +curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | sed '1,33d' > /etc/adblock_hosts + +# Custom domains that I need to preserve for some reason +sed -i -e '/segment.com/d' /etc/adblock_hosts # Blocks Trelly content for house investors +sed -i -e '/segment.io/d' /etc/adblock_hosts # Blocks Trelly content for house investors + +systemctl restart dnsmasq diff --git a/hosts/genesis/dnsmasq.nix b/hosts/genesis/dnsmasq.nix index 296a020..174cd44 100644 --- a/hosts/genesis/dnsmasq.nix +++ b/hosts/genesis/dnsmasq.nix @@ -24,6 +24,8 @@ let ]; lanDevice = "enp1s0"; + + adblockUpdate = pkgs.writeShellScriptBin "adblockUpdate" (builtins.readFile ./adblockUpdate.sh); in { # Enable the service with its own configuration @@ -96,7 +98,7 @@ in services.cron = { enable = true; systemCronJobs = [ - "* * * * * root ( ${pkgs.curl}/bin/curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | sed '1,33d' > /etc/adblock_hosts && systemctl restart dnsmasq ) 2>&1 > /var/log/adblock.log" + "* * * * * root ${adblockUpdate} 2>&1 > /var/log/adblock.log" ]; }; From f982dbe48dda12234751ff8e7f8155e6bed163cf Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 25 Aug 2023 15:52:01 -0500 Subject: [PATCH 3/3] Fix pkgs and add busybox to genesis --- hosts/genesis/dnsmasq.nix | 5 ++++- modules-linux/default.nix | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hosts/genesis/dnsmasq.nix b/hosts/genesis/dnsmasq.nix index 174cd44..e398ce7 100644 --- a/hosts/genesis/dnsmasq.nix +++ b/hosts/genesis/dnsmasq.nix @@ -92,7 +92,10 @@ in }; extraConfig = "${extraConfig}"; }; - environment.systemPackages = [ pkgs.curl ]; + environment.systemPackages = with pkgs; [ + busybox + curl + ]; # Regularly update DNS block list services.cron = { diff --git a/modules-linux/default.nix b/modules-linux/default.nix index c90c688..c314b23 100644 --- a/modules-linux/default.nix +++ b/modules-linux/default.nix @@ -15,7 +15,7 @@ ./tailscale.nix ]; - environment.systemPackages = [ + environment.systemPackages = with pkgs; [ lshw ];