System/machines/perception/configuration.nix

108 lines
2.6 KiB
Nix
Raw Normal View History

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;
# Run plex and the like in containers
virtualisation.oci-containers.containers = {
# Configure plex
"plex" = {
image = "lscr.io/linuxserver/plex:latest";
environment = {
"PUID" = "1000";
"PGID" = "1000";
"TZ" = "America/New_York";
"VERSION" = "latest";
};
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
2023-04-09 12:22:10 -04:00
"tautulli" = {
image = "lscr.io/linuxserver/tautulli:latest";
environment = {
"PUID" = "1000";
"PGID" = "1000";
"TZ" = "America/New_York";
};
ports = [ "8181:8181" ];
volumes = [ "/var/lib/tautulli:/config" ];
};
2023-04-09 00:41:21 -04:00
# Configure sabnzbd
# Configure sonarr
# Configure radarr
2023-04-09 00:29:51 -04:00
};
2023-04-08 23:20:43 -04:00
}