2023-04-08 23:20:43 -04:00
|
|
|
{ config, lib, pkgs, inputs, ... }:
|
|
|
|
|
|
|
|
{
|
2023-04-08 23:57:42 -04:00
|
|
|
# Setup hardware
|
2023-04-09 00:41:21 -04:00
|
|
|
# imports = [ inputs.nixos-hardware.nixosModules.common-cpu-intel ];
|
2023-04-08 23:20:43 -04:00
|
|
|
# Sops setup for this machine
|
|
|
|
sops.secrets = {
|
|
|
|
"borg-ssh-key" = {
|
|
|
|
sopsFile = ../../secrets/perception/borg.yaml;
|
|
|
|
format = "yaml";
|
|
|
|
};
|
|
|
|
"borg-password" = {
|
|
|
|
sopsFile = ../../secrets/perception/borg.yaml;
|
|
|
|
format = "yaml";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# Setup system configuration
|
|
|
|
nathan = {
|
|
|
|
services = {
|
|
|
|
borg = {
|
|
|
|
enable = true;
|
|
|
|
extraExcludes = [ "/var/log" ];
|
|
|
|
passwordFile = config.sops.secrets."borg-password".path;
|
|
|
|
sshKey = config.sops.secrets."borg-ssh-key".path;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = {
|
2023-04-08 23:36:46 -04:00
|
|
|
setupGrub = false;
|
2023-04-08 23:20:43 -04:00
|
|
|
nix = {
|
|
|
|
autoUpdate = true;
|
|
|
|
autoGC = true;
|
|
|
|
};
|
|
|
|
harden = false;
|
|
|
|
};
|
|
|
|
};
|
2023-04-08 23:36:46 -04:00
|
|
|
|
|
|
|
# Configure bootloader
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
|
|
boot.kernelParams = [ "net.ifnames=0" ];
|
2023-04-08 23:20:43 -04:00
|
|
|
# Configure networking
|
|
|
|
networking = {
|
|
|
|
domain = "mccarty.io";
|
|
|
|
useDHCP = true;
|
|
|
|
# Open ports in firewall
|
|
|
|
firewall = {
|
|
|
|
allowedTCPPorts = [ ];
|
|
|
|
allowedUDPPorts = [ ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Setup home manager
|
|
|
|
home-manager.users.nathan = import ./home.nix;
|
2023-04-09 00:29:51 -04:00
|
|
|
## Media Streaming setup
|
2023-04-09 00:41:21 -04:00
|
|
|
|
|
|
|
# Setup hardware
|
2023-04-09 00:29:51 -04:00
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
|
|
|
driSupport = true;
|
2023-04-09 00:30:35 -04:00
|
|
|
driSupport32Bit = true;
|
2023-04-09 00:41:21 -04:00
|
|
|
extraPackages = with pkgs; [ libva vaapiIntel libvdpau-va-gl vaapiVdpau ];
|
|
|
|
};
|
|
|
|
# Newer kernel
|
|
|
|
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_2;
|
2023-04-09 11:50:20 -04:00
|
|
|
# Run plex and the like in containers
|
|
|
|
virtualisation.oci-containers.containers = {
|
|
|
|
# Configure plex
|
|
|
|
"plex" = {
|
|
|
|
image = "lscr.io/linuxserver/plex:latest";
|
|
|
|
environment = {
|
2023-04-09 11:51:56 -04:00
|
|
|
"PUID" = "1000";
|
|
|
|
"PGID" = "1000";
|
2023-04-09 11:51:25 -04:00
|
|
|
"TZ" = "America/New_York";
|
|
|
|
"VERSION" = "latest";
|
2023-04-09 11:55:12 -04:00
|
|
|
"PLEX_CLAIM" = "claim-xxHsSs7f3Z6zY6EokYyX";
|
2023-04-09 11:50:20 -04:00
|
|
|
};
|
|
|
|
ports = [
|
|
|
|
"32400:32400"
|
|
|
|
"1900:1900"
|
|
|
|
"3005:3005"
|
|
|
|
"5353:5353"
|
|
|
|
"8324:8324"
|
|
|
|
"32410:32410"
|
|
|
|
"32412:32412"
|
|
|
|
"32413:32413"
|
|
|
|
"32414:32414"
|
|
|
|
"32469:32469"
|
|
|
|
];
|
|
|
|
volumes = [ "/var/lib/plex:/config" "/mnt/plex:/media" ];
|
|
|
|
extraOptions = [ "--device=/dev/dri:/dev/dri" ];
|
|
|
|
};
|
|
|
|
# Configure tatulli
|
|
|
|
# Configure sabnzbd
|
|
|
|
# Configure sonarr
|
|
|
|
# Configure radarr
|
|
|
|
};
|
2023-04-08 23:20:43 -04:00
|
|
|
}
|