2023-04-08 23:20:43 -04:00
|
|
|
{ config, lib, pkgs, inputs, ... }:
|
|
|
|
|
|
|
|
{
|
2023-04-08 23:57:42 -04:00
|
|
|
# Setup hardware
|
|
|
|
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 01:08:40 -04:00
|
|
|
|
2023-04-09 00:57:09 -04:00
|
|
|
# Setup hardware
|
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
2023-04-09 01:23:31 -04:00
|
|
|
driSupport = true;
|
|
|
|
driSupport32Bit = true;
|
2023-04-09 00:57:09 -04:00
|
|
|
extraPackages = with pkgs; [
|
2023-04-09 01:23:31 -04:00
|
|
|
libva
|
|
|
|
vaapiIntel
|
2023-04-09 00:57:09 -04:00
|
|
|
libvdpau-va-gl
|
2023-04-09 01:23:31 -04:00
|
|
|
vaapiVdpau
|
2023-04-09 01:38:16 -04:00
|
|
|
intel-ocl
|
2023-04-09 00:57:09 -04:00
|
|
|
];
|
2023-04-09 01:49:14 -04:00
|
|
|
extraPackages32 = with pkgs.pkgsi686Linux; [
|
|
|
|
libva
|
|
|
|
vaapiIntel
|
|
|
|
libvdpau-va-gl
|
|
|
|
vaapiVdpau
|
|
|
|
];
|
2023-04-09 00:57:09 -04:00
|
|
|
};
|
2023-04-09 00:41:21 -04:00
|
|
|
# Configure plex
|
|
|
|
services.plex = let
|
2023-04-09 01:08:40 -04:00
|
|
|
plexPass = pkgs.plex.override {
|
|
|
|
plexRaw = pkgs.plexRaw.overrideAttrs (_: rec {
|
|
|
|
version = "1.32.0.6918-6f393eda1";
|
|
|
|
src = pkgs.fetchurl {
|
|
|
|
url =
|
|
|
|
"https://downloads.plex.tv/plex-media-server-new/${version}/debian/plexmediaserver_${version}_amd64.deb";
|
|
|
|
sha256 = "sha256-9rGmUk0m7tBLSo5LeQ1fv2rnmK7WQ9AVDUPU0aqXLrM=";
|
|
|
|
};
|
2023-04-09 01:38:16 -04:00
|
|
|
buildInputs = with pkgs; [
|
|
|
|
libva
|
|
|
|
vaapiIntel
|
|
|
|
libvdpau-va-gl
|
|
|
|
vaapiVdpau
|
|
|
|
intel-ocl
|
|
|
|
];
|
2023-04-09 01:08:40 -04:00
|
|
|
});
|
|
|
|
};
|
2023-04-09 00:41:21 -04:00
|
|
|
in {
|
2023-04-09 00:29:51 -04:00
|
|
|
enable = true;
|
2023-04-09 00:41:21 -04:00
|
|
|
package = plexPass;
|
|
|
|
openFirewall = true;
|
2023-04-09 00:29:51 -04:00
|
|
|
};
|
2023-04-09 00:57:09 -04:00
|
|
|
# Configure tatulli
|
|
|
|
services.tautulli = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
2023-04-08 23:20:43 -04:00
|
|
|
}
|