1 Commits

Author SHA1 Message Date
1412e1cc79 add a yubikey module 2024-08-14 00:20:07 -04:00
23 changed files with 245 additions and 209 deletions

View File

@ -8,7 +8,6 @@
"acpid",
"adbusers",
"ahci",
"aioesphomeapi",
"alicehuston",
"alsa",
"amdgpu",
@ -67,7 +66,6 @@
"enableemail",
"errorlens",
"esbenp",
"esphome",
"extest",
"fastforwardteam",
"FASTFOX",
@ -92,7 +90,6 @@
"gamescope",
"globalprivacycontrol",
"gparted",
"gtts",
"healthreport",
"hexeditor",
"hicolor",
@ -107,9 +104,7 @@
"hyprland",
"hyprwm",
"INITDB",
"ioit",
"iperf",
"isal",
"jmgilman",
"jnoortheen",
"jobset",
@ -188,13 +183,11 @@
"PRIVOXY",
"prowlarr",
"proxychains",
"prusa",
"psycopg",
"PUID",
"pulseaudio",
"punycode",
"pylance",
"pymetno",
"qbit",
"qbittorrent",
"qbittorrentvpn",
@ -232,7 +225,6 @@
"sponsorblock",
"spotifyd",
"sqltools",
"ssdp",
"sshconfig",
"stdenv",
"subresource",
@ -279,7 +271,6 @@
"xhci",
"xwayland",
"yzhang",
"zeroconf",
"zerotier",
"zerotierone",
"zhaofengli",

202
flake.lock generated
View File

@ -1,5 +1,27 @@
{
"nodes": {
"arch_mirror": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"poetry2nix": "poetry2nix"
},
"locked": {
"lastModified": 1722708775,
"narHash": "sha256-z+8+fB0/8G9ScnDmgHKzR6BMxuTiK8mu0HDdp2y0dqQ=",
"owner": "RichieCahill",
"repo": "arch_mirror",
"rev": "ce97f5f7e7382f6cb36e464c0f18a3177396990d",
"type": "github"
},
"original": {
"owner": "RichieCahill",
"repo": "arch_mirror",
"type": "github"
}
},
"attic": {
"inputs": {
"crane": "crane",
@ -109,6 +131,24 @@
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": [
"systems"
@ -192,7 +232,29 @@
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"system_tools",
"arch_mirror",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703863825,
"narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-github-actions_2": {
"inputs": {
"nixpkgs": [
"server_tools",
"poetry2nix",
"nixpkgs"
]
@ -353,23 +415,51 @@
"poetry2nix": {
"inputs": {
"flake-utils": [
"system_tools",
"arch_mirror",
"flake-utils"
],
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"system_tools",
"arch_mirror",
"nixpkgs"
],
"systems": "systems",
"systems": "systems_2",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1723343306,
"narHash": "sha256-/6sRkPq7/5weX2y0V8sQ29Sz35nt8kyj+BsFtkhgbJE=",
"lastModified": 1722515463,
"narHash": "sha256-6FVPz1WzHak65xJQg8tRjVyFEWMesGxfskKaCxDUnRk=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "4a1c112ff0c67f496573dc345bd0b2247818fc29",
"rev": "8c25e871bba3f472e1569bbf6c0f52dcc34bf2a4",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"poetry2nix_2": {
"inputs": {
"flake-utils": [
"server_tools",
"flake-utils"
],
"nix-github-actions": "nix-github-actions_2",
"nixpkgs": [
"server_tools",
"nixpkgs"
],
"systems": "systems_3",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1721039874,
"narHash": "sha256-XANsG9GYHip8pxZpbqKf/YGv8tIa0xTh289Y+WNBNfw=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "d11c01e58587e5f21037ed6477465a7f26a32e27",
"type": "github"
},
"original": {
@ -407,11 +497,12 @@
},
"root": {
"inputs": {
"arch_mirror": "arch_mirror",
"attic": "attic",
"firefox-addons": "firefox-addons",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"home-manager": "home-manager",
"hyprland-contrib": "hyprland-contrib",
"nix-index-database": "nix-index-database",
@ -422,9 +513,9 @@
"nixpkgs-stable": "nixpkgs-stable",
"pre-commit-hooks": "pre-commit-hooks",
"rust-overlay": "rust-overlay",
"server_tools": "server_tools",
"sops-nix": "sops-nix",
"system_tools": "system_tools",
"systems": "systems_2",
"systems": "systems_4",
"wired-notify": "wired-notify"
}
},
@ -473,6 +564,30 @@
"type": "github"
}
},
"server_tools": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"poetry2nix": "poetry2nix_2"
},
"locked": {
"lastModified": 1722726877,
"narHash": "sha256-VEfypyflLdxL3hjtURbpfRv9dyc3Z/CvvZ76bAad8l8=",
"owner": "RAD-Development",
"repo": "server_tools",
"rev": "16f24eddcb117c5560582c42c120ba84360c7f1f",
"type": "github"
},
"original": {
"owner": "RAD-Development",
"repo": "server_tools",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
@ -496,31 +611,22 @@
"type": "github"
}
},
"system_tools": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"poetry2nix": "poetry2nix"
},
"systems": {
"locked": {
"lastModified": 1723392261,
"narHash": "sha256-Csa4yuYWcB3aLf7VP14v+Mp0lRzOOCCt9BdmAeeQcYU=",
"owner": "RAD-Development",
"repo": "system_tools",
"rev": "51bcc923b2b3cfb832b05687a01805c5a905b0c9",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "RAD-Development",
"repo": "system_tools",
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems": {
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -534,7 +640,21 @@
"type": "indirect"
}
},
"systems_2": {
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"id": "systems",
"type": "indirect"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -552,7 +672,29 @@
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"system_tools",
"arch_mirror",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719749022,
"narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"server_tools",
"poetry2nix",
"nixpkgs"
]

View File

@ -29,6 +29,11 @@
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
systems.url = "github:nix-systems/default";
arch_mirror = {
url = "github:RichieCahill/arch_mirror";
inputs.nixpkgs.follows = "nixpkgs";
};
attic = {
url = "github:zhaofengli/attic";
inputs = {
@ -104,8 +109,8 @@
};
};
system_tools = {
url = "github:RAD-Development/system_tools";
server_tools = {
url = "github:RAD-Development/server_tools";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";

View File

@ -9,6 +9,7 @@ in
"${../../users/richie/global/docker_templates}/file_server/sites/:/etc/apache2/sites-enabled/"
"${vars.main_mirror}:/data"
];
ports = [ "800:80" ];
extraOptions = [ "--network=web" ];
autoStart = true;
};
@ -22,7 +23,7 @@ in
serviceConfig = {
Environment = "MIRROR_DIR=${vars.main_mirror}/archlinux/";
Type = "simple";
ExecStart = "${inputs.system_tools.packages.x86_64-linux.default}/bin/sync_mirror";
ExecStart = "${inputs.arch_mirror.packages.x86_64-linux.default}/bin/sync_mirror";
};
};
}

View File

@ -2,29 +2,50 @@
{
imports = [
../../users/richie/global/ssh.nix
../../users/richie/global/zerotier.nix
./arch_mirror.nix
./docker
./home_assistant.nix
./networking.nix
./services.nix
];
networking = {
hostId = "1beb3026";
firewall.enable = false;
};
boot = {
zfs.extraPools = [ "Main" ];
filesystem = "zfs";
useSystemdBoot = true;
};
environment.systemPackages = with pkgs; [ docker-compose ];
environment = {
systemPackages = with pkgs; [ docker-compose ];
etc = {
# Creates /etc/lynis/custom.prf
"lynis/custom.prf" = {
text = ''
skip-test=BANN-7126
skip-test=BANN-7130
skip-test=DEB-0520
skip-test=DEB-0810
skip-test=FIRE-4513
skip-test=HRDN-7222
skip-test=KRNL-5820
skip-test=LOGG-2190
skip-test=LYNIS
skip-test=TOOL-5002
'';
mode = "0440";
};
};
};
services = {
openssh = {
ports = [ 352 ];
listenAddresses = [
{ addr = "192.168.95.35"; }
{ addr = "192.168.90.35"; }
];
};
nfs.server.enable = true;
openssh.ports = [ 352 ];
smartd.enable = true;

View File

@ -26,11 +26,9 @@ frontend ContentSwitching
# tmmworkshop.com
acl host_mirror hdr(host) -i mirror.tmmworkshop.com jeeves
acl host_uptime_kuma hdr(host) -i uptimekuma-jeevesjr.tmmworkshop.com
acl host_homeassistant hdr(host) -i homeassistant.tmmworkshop.com
use_backend mirror_nodes if host_mirror
use_backend uptime_kuma_nodes if host_uptime_kuma
use_backend home_asistant_nodes if host_homeassistant
# tmmworkshop.com
backend mirror_nodes
@ -40,7 +38,3 @@ backend mirror_nodes
backend uptime_kuma_nodes
mode http
server server uptime_kuma:3001
backend home_asistant_nodes
mode http
server server 192.168.95.35:8123

View File

@ -8,6 +8,7 @@
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
networking.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
swapDevices = [ { device = "/dev/disk/by-uuid/9d4ef549-d426-489d-8332-0a49589c6aed"; } ];
boot = {

View File

@ -3,47 +3,15 @@
enable = true;
openFirewall = true;
config = {
http = {
server_port = 8123;
server_host = [
"192.168.95.35"
"192.168.90.35"
"192.168.98.4"
];
use_x_forwarded_for = true;
trusted_proxies = "172.100.0.4";
};
server_port = 8123;
homeassistant = {
time_zone = "America/New_York";
unit_system = "imperial";
temperature_unit = "F";
longitude = 40.74;
latitude = 74.03;
};
assist_pipeline = { };
backup = { };
bluetooth = { };
config = { };
dhcp = { };
energy = { };
history = { };
homeassistant_alerts = { };
image_upload = { };
logbook = { };
media_source = { };
mobile_app = { };
ssdp = { };
sun = { };
webhook = { };
zeroconf = { };
};
extraPackages =
python3Packages: with python3Packages; [
psycopg2
gtts
aioesphomeapi
esphome-dashboard-api
bleak-esphome
pymetno
];
extraComponents = [ "isal" ];
extraPackages = python3Packages: with python3Packages; [ psycopg2 ];
};
}

View File

@ -1,43 +0,0 @@
{
networking = {
hostId = "1beb3026";
firewall.enable = false;
};
systemd.network = {
enable = true;
netdevs = {
"20-ioit-vlan" = {
netdevConfig = {
Kind = "vlan";
Name = "ioit-vlan";
};
vlanConfig.Id = 20;
};
};
networks = {
"10-lan" = {
matchConfig.Name = "enp4s0";
DHCP = "yes";
vlan = [ "ioit-vlan" ];
linkConfig.RequiredForOnline = "routable";
};
"40-ioit-vlan" = {
matchConfig.Name = "ioit-vlan";
DHCP = "yes";
};
};
};
services.zerotierone = {
enable = true;
joinNetworks = [ "e4da7455b2ae64ca" ];
};
}
# 22/tcp open ssh
# 800/tcp open mdbs_daemon
# 5355/tcp open llmnr
# 8123/tcp open polipo
# 9993/tcp open palace-2

View File

@ -15,7 +15,7 @@
serviceConfig = {
Type = "oneshot";
EnvironmentFile = config.sops.secrets."server-validation/webhook".path;
ExecStart = "${inputs.system_tools.packages.x86_64-linux.default}/bin/validate_jeevesjr";
ExecStart = "${inputs.server_tools.packages.x86_64-linux.default}/bin/validate_jeevesjr";
};
};
timers.startup_validation = {

View File

@ -23,7 +23,7 @@ in
serviceConfig = {
Environment = "MIRROR_DIR=${vars.media_mirror}/archlinux/";
Type = "simple";
ExecStart = "${inputs.system_tools.packages.x86_64-linux.default}/bin/sync_mirror";
ExecStart = "${inputs.arch_mirror.packages.x86_64-linux.default}/bin/sync_mirror";
};
};
}

View File

@ -6,13 +6,18 @@ in
imports = [
../../users/richie/global/ssh.nix
../../users/richie/global/syncthing_base.nix
../../users/richie/global/zerotier.nix
./arch_mirror.nix
./docker
./networking.nix
./programs.nix
./services.nix
];
networking = {
hostId = "1beb3027";
firewall.enable = false;
};
boot = {
zfs.extraPools = [
"media"

View File

@ -30,14 +30,12 @@ frontend ContentSwitching
acl host_grafana hdr(host) -i grafana.tmmworkshop.com
acl host_filebrowser hdr(host) -i filebrowser.tmmworkshop.com
acl host_uptime_kuma hdr(host) -i uptimekuma-jeeves.tmmworkshop.com
acl host_overseerr hdr(host) -i overseerr.tmmworkshop.com
use_backend mirror_nodes if host_mirror
use_backend dndrules_nodes if host_dndrules
use_backend grafana_nodes if host_grafana
use_backend filebrowser_nodes if host_filebrowser
use_backend uptime_kuma_nodes if host_uptime_kuma
use_backend overseerr_nodes if host_overseerr
backend mirror_nodes
mode http
@ -62,7 +60,3 @@ backend filebrowser_nodes
backend uptime_kuma_nodes
mode http
server server uptime_kuma:3001
backend overseerr_nodes
mode http
server server overseerr:5055

View File

@ -113,13 +113,15 @@ in
autoStart = true;
};
overseerr = {
image = "ghcr.io/linuxserver/overseerr:latest";
image = "ghcr.io/linuxserver/overseerr";
environment = {
PUID = "600";
PGID = "100";
TZ = "America/New_York";
};
volumes = [ "${vars.media_docker_configs}/overseerr:/config" ];
# TODO: remove ports later since this is going through web
ports = [ "5055:5055" ];
dependsOn = [
"radarr"
"sonarr"
@ -127,18 +129,6 @@ in
extraOptions = [ "--network=web" ];
autoStart = true;
};
unpackerr = {
image = "golift/unpackerr:latest";
user = "600:100";
environment = {
TZ = "America/New_York";
};
volumes = [
"${vars.torrenting_qbit}:/data"
"${config.sops.secrets.unpackerr_conf}:/etc/unpackerr/unpackerr.conf"
];
autoStart = true;
};
whisper = {
image = "ghcr.io/linuxserver/faster-whisper:latest";
ports = [ "10300:10300" ];

View File

@ -35,7 +35,6 @@ in
"dnd_file_server"
"filebrowser"
"grafana"
"overseerr"
"uptime_kuma"
];
extraOptions = [ "--network=web" ];

View File

@ -40,6 +40,17 @@
swapDevices = [ { device = "/dev/disk/by-uuid/4c797a94-be32-43d3-89ac-7f02912c7cf5"; } ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp38s0f3u2u2c2.useDHCP = lib.mkDefault true;
# networking.interfaces.enp97s0f0np0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp97s0f1np1.useDHCP = lib.mkDefault true;
# networking.interfaces.enp98s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp98s0f1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,40 +0,0 @@
{
networking = {
hostId = "1beb3027";
firewall.enable = false;
};
systemd.network = {
enable = true;
networks = {
"10-1GB_Primary" = {
matchConfig.Name = "enp98s0f0";
DHCP = "yes";
};
};
networks = {
"10-1GB_Secondary" = {
matchConfig.Name = "enp98s0f1";
DHCP = "yes";
};
};
networks = {
"10-10GB_Primary" = {
matchConfig.Name = "enp97s0f0np0";
DHCP = "yes";
linkConfig.RequiredForOnline = "routable";
};
};
networks = {
"10-10GB_Secondary" = {
matchConfig.Name = "enp97s0f1np1";
DHCP = "yes";
};
};
};
services.zerotierone = {
enable = true;
joinNetworks = [ "e4da7455b2ae64ca" ];
};
}

View File

@ -23,7 +23,7 @@
serviceConfig = {
EnvironmentFile = config.sops.secrets."server-validation/webhook".path;
Type = "oneshot";
ExecStart = "${inputs.system_tools.packages.x86_64-linux.default}/bin/validate_jeeves";
ExecStart = "${inputs.server_tools.packages.x86_64-linux.default}/bin/validate_jeeves";
};
};
};

View File

@ -15,7 +15,7 @@
serviceConfig = {
Type = "oneshot";
EnvironmentFile = config.sops.secrets."server-validation/webhook".path;
ExecStart = "${inputs.system_tools.packages.x86_64-linux.default}/bin/validate_palatine_hill";
ExecStart = "${inputs.server_tools.packages.x86_64-linux.default}/bin/validate_palatine_hill";
};
};
timers.startup_validation = {

View File

@ -21,6 +21,5 @@
util-linux
vlc
zoom-us
prusa-slicer
];
}

View File

@ -50,6 +50,9 @@
// force the use of rust-analyzer from dev shell
"rust-analyzer.server.path": "rust-analyzer",
// other
"python.analysis.typeCheckingMode": "basic",
"redhat.telemetry.enabled": true,
"gitlens.plusFeatures.enabled": false,
// new

View File

@ -43,6 +43,7 @@
nix-prefetch
nix-tree
nixpkgs-fmt
inputs.system_tools.packages.x86_64-linux.default
inputs.server_tools.packages.x86_64-linux.default
inputs.arch_mirror.packages.x86_64-linux.default
];
}

View File

@ -30,12 +30,6 @@
identityFile = "~/.ssh/id_ed25519";
port = 922;
};
palatine-hill = {
hostname = "192.168.76.2";
user = "richie";
identityFile = "~/.ssh/id_ed25519";
port = 666;
};
};
};
}