Files
nixos/hosts/unstable/genesis/default.nix
T

79 lines
1.9 KiB
Nix
Raw Normal View History

2023-06-29 00:27:30 -05:00
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
2025-12-30 20:21:16 -06:00
{ lib, pkgs, ... }:
2023-06-29 00:27:30 -05:00
2025-12-30 20:21:16 -06:00
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"; do
sed -i -e "/''${f}/d" /etc/adblock_hosts # Blocks Trelly content for house investors
done
systemctl restart dnsmasq
'';
};
in
2023-06-29 00:27:30 -05:00
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./networking.nix
];
2023-09-02 20:07:12 -05:00
2025-02-18 15:14:17 -06:00
greg = {
home = true;
gnome.enable = false;
proxies = {
};
};
2024-02-20 14:49:48 -06:00
# Bootloader.
2025-12-26 23:50:53 -06:00
boot.loader = {
efi = {
canTouchEfiVariables = true;
};
systemd-boot = {
enable = true;
configurationLimit = 10;
edk2-uefi-shell.enable = true;
};
};
environment.systemPackages = with pkgs; [
create_ssl
step-ca
];
2025-02-18 15:14:17 -06:00
networking.hostName = "genesis"; # Define your hostname.
2025-12-30 20:21:16 -06:00
systemd = {
services.adblock-update = {
after = [ "network-online.target" ];
2026-01-08 10:54:08 -06:00
requires = [ "network-online.target" ];
2025-12-30 20:21:16 -06:00
script = lib.getExe adblockUpdate;
serviceConfig.Type = "oneshot";
};
timers.adblock-update = {
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
2026-01-08 10:54:08 -06:00
requires = [ "network-online.target" ];
2025-12-30 20:21:16 -06:00
timerConfig = {
OnCalendar = "daily";
Unit = "adblock-update.service";
};
};
};
2023-06-29 00:27:30 -05:00
}