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 02:39:37 -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 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 11:24:22 -04:00
|
|
|
extraPackages = with pkgs; [ libva vaapiIntel libvdpau-va-gl vaapiVdpau ];
|
2023-04-09 00:57:09 -04:00
|
|
|
};
|
2023-04-09 02:21:51 -04:00
|
|
|
# Newer kernel
|
|
|
|
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_2;
|
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 11:24:22 -04:00
|
|
|
buildInputs = with pkgs;
|
|
|
|
[
|
|
|
|
# inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.libva
|
|
|
|
# inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.vaapiIntel
|
|
|
|
# inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.libvdpau-va-gl
|
|
|
|
# inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.vaapiVdpau
|
|
|
|
];
|
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 02:36:20 -04:00
|
|
|
package = plexPass;
|
|
|
|
# package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.plex;
|
2023-04-09 00:41:21 -04:00
|
|
|
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
|
|
|
}
|