2022-08-01 18:10:41 -04:00
|
|
|
{ config, lib, pkgs, inputs, ... }:
|
2022-07-03 00:43:50 -04:00
|
|
|
|
|
|
|
{
|
2022-07-04 17:41:18 -04:00
|
|
|
# Sops setup for this machine
|
|
|
|
sops.secrets = {
|
|
|
|
"borg-ssh-key" = {
|
|
|
|
sopsFile = ../../secrets/levitation/borg.yaml;
|
|
|
|
format = "yaml";
|
|
|
|
};
|
|
|
|
"borg-password" = {
|
|
|
|
sopsFile = ../../secrets/levitation/borg.yaml;
|
|
|
|
format = "yaml";
|
|
|
|
};
|
|
|
|
"windows-bitlocker-key" = {
|
|
|
|
sopsFile = ../../secrets/levitation/windows.yaml;
|
|
|
|
format = "yaml";
|
|
|
|
};
|
2022-07-03 00:43:50 -04:00
|
|
|
};
|
|
|
|
# Setup system configuration
|
|
|
|
nathan = {
|
2022-10-13 22:13:43 -04:00
|
|
|
programs = { games = true; };
|
2022-07-03 00:43:50 -04:00
|
|
|
services = {
|
|
|
|
borg = {
|
|
|
|
enable = true;
|
|
|
|
extraExcludes = [
|
|
|
|
"/home/${config.nathan.config.user}/Music"
|
|
|
|
"/var/lib/docker"
|
|
|
|
"/var/log"
|
|
|
|
];
|
|
|
|
passwordFile = config.sops.secrets."borg-password".path;
|
|
|
|
sshKey = config.sops.secrets."borg-ssh-key".path;
|
|
|
|
};
|
2022-11-22 22:16:10 -05:00
|
|
|
kubo = { enable = true; };
|
2022-12-26 09:54:23 -05:00
|
|
|
# resolved = { enable = true; };
|
2022-07-03 00:43:50 -04:00
|
|
|
};
|
2022-11-05 23:54:11 -04:00
|
|
|
hardware = {
|
|
|
|
amdPassthrough = true;
|
|
|
|
printing = true;
|
|
|
|
};
|
2022-07-03 00:43:50 -04:00
|
|
|
config = {
|
|
|
|
isDesktop = true;
|
|
|
|
setupGrub = true;
|
|
|
|
nix.autoUpdate = false;
|
2022-07-18 16:37:10 -04:00
|
|
|
harden = false;
|
2022-07-04 17:41:18 -04:00
|
|
|
windows = {
|
|
|
|
enable = true;
|
|
|
|
mount = {
|
|
|
|
device = "/dev/nvme0n1p3";
|
|
|
|
mountPoint = "/mnt/windows";
|
|
|
|
keyFile = config.sops.secrets."windows-bitlocker-key".path;
|
|
|
|
};
|
|
|
|
};
|
2022-07-03 00:43:50 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
# Configure networking
|
|
|
|
networking = {
|
|
|
|
domain = "mccarty.io";
|
|
|
|
useDHCP = false;
|
|
|
|
interfaces.enp6s0.useDHCP = true;
|
|
|
|
nat.externalInterface = "enp6s0";
|
|
|
|
# Open ports for soulseek
|
|
|
|
firewall = {
|
|
|
|
allowedTCPPorts = [ 61377 ];
|
|
|
|
allowedUDPPorts = [ 61377 ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Setup home manager
|
|
|
|
home-manager.users.nathan = import ./home.nix;
|
2022-07-24 13:52:34 -04:00
|
|
|
|
|
|
|
# TPM setup
|
2022-10-13 22:13:43 -04:00
|
|
|
security = { tpm2 = { enable = true; }; };
|
2022-08-01 18:10:41 -04:00
|
|
|
|
2022-09-20 13:12:24 -04:00
|
|
|
# Configure nix build
|
|
|
|
nix.settings = {
|
2022-09-26 00:05:25 -04:00
|
|
|
cores = 8;
|
2023-01-11 10:28:23 -05:00
|
|
|
max-jobs = 6;
|
|
|
|
system-features = [ "gccarch-znver3" ];
|
2022-09-20 13:12:24 -04:00
|
|
|
};
|
2022-11-05 03:18:08 -04:00
|
|
|
|
|
|
|
# Calibre
|
|
|
|
services.calibre-web = {
|
|
|
|
enable = true;
|
|
|
|
user = "nathan";
|
|
|
|
group = "users";
|
|
|
|
openFirewall = true;
|
|
|
|
listen = { ip = "100.95.223.6"; };
|
|
|
|
options = {
|
|
|
|
calibreLibrary = "/home/nathan/Books";
|
|
|
|
enableBookConversion = true;
|
|
|
|
enableBookUploading = true;
|
|
|
|
};
|
|
|
|
};
|
2023-01-11 10:28:23 -05:00
|
|
|
|
|
|
|
nixpkgs = {
|
|
|
|
# Native opts go nyoom
|
|
|
|
localSystem = {
|
|
|
|
gcc = {
|
|
|
|
arch = "znver3";
|
|
|
|
tune = "znver3";
|
|
|
|
};
|
|
|
|
system = "x86_64-linux";
|
|
|
|
};
|
|
|
|
# Fix some packages that are broken on nixos-21.11 with march=znver3
|
|
|
|
# We'll substitute these with the version from a second import of nixpkgs without the gcc
|
|
|
|
# configuration.
|
|
|
|
overlays = [
|
|
|
|
(self: super:
|
|
|
|
let
|
|
|
|
vanilla-pkgs = import inputs.nixpkgs-unstable {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
config = {
|
|
|
|
localSystem = {
|
|
|
|
gcc = {
|
|
|
|
arch = null;
|
|
|
|
tune = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
libxcrypt = vanilla-pkgs.libxcrypt;
|
|
|
|
perl = vanilla-pkgs.perl;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
2022-07-03 00:43:50 -04:00
|
|
|
}
|