applied nixfmt (new version)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{ lib, modulesPath, ... }: {
|
||||
{ lib, modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
hardware = {
|
||||
@@ -129,13 +130,15 @@
|
||||
'';
|
||||
};
|
||||
};
|
||||
swapDevices = [{
|
||||
device = "/dev/nvme0n1p3";
|
||||
randomEncryption = {
|
||||
enable = true;
|
||||
cipher = "aes-xts-plain64";
|
||||
keySize = 512;
|
||||
sectorSize = 4096;
|
||||
};
|
||||
}];
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/dev/nvme0n1p3";
|
||||
randomEncryption = {
|
||||
enable = true;
|
||||
cipher = "aes-xts-plain64";
|
||||
keySize = 512;
|
||||
sectorSize = 4096;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
proxy = locations: {
|
||||
inherit locations;
|
||||
@@ -6,7 +11,8 @@ let
|
||||
enableACME = true;
|
||||
http2 = true;
|
||||
};
|
||||
proxyReverse = port:
|
||||
proxyReverse =
|
||||
port:
|
||||
proxy {
|
||||
"/" = {
|
||||
proxyPass = "http://192.168.1.69:${toString port}";
|
||||
@@ -16,14 +22,14 @@ let
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_redirect http://192.168.1.69:${
|
||||
toString port
|
||||
}/ https://your_domain.com/;
|
||||
proxy_redirect http://192.168.1.69:${toString port}/ https://your_domain.com/;
|
||||
'';
|
||||
};
|
||||
};
|
||||
proxyReverseArr = port:
|
||||
proxyReverse port // {
|
||||
proxyReverseArr =
|
||||
port:
|
||||
proxyReverse port
|
||||
// {
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
@@ -32,7 +38,8 @@ let
|
||||
proxy_http_version 1.1;
|
||||
'';
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
services = {
|
||||
nginx = {
|
||||
appendHttpConfig = ''
|
||||
@@ -47,10 +54,8 @@ in {
|
||||
"movies.${config.my.domain}" = proxyReverseArr 7878 // { };
|
||||
"indexer.${config.my.domain}" = proxyReverseArr 9696 // { };
|
||||
"music.${config.my.domain}" = proxyReverseArr 8686 // { };
|
||||
"subs.${config.my.domain}" =
|
||||
proxyReverse config.services.bazarr.listenPort // { };
|
||||
"library.${config.my.domain}" = proxyReverse config.services.kavita.port
|
||||
// { };
|
||||
"subs.${config.my.domain}" = proxyReverse config.services.bazarr.listenPort // { };
|
||||
"library.${config.my.domain}" = proxyReverse config.services.kavita.port // { };
|
||||
"vnfx2cojmt7dwzcfmi73.${config.my.domain}" = proxyReverse 9091 // { };
|
||||
"HSoeJdGRd2Orj0n31UGI.${config.my.domain}" = proxyReverse 3399 // { };
|
||||
"flix.${config.my.domain}" = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ lib, modulesPath, ... }: {
|
||||
{ lib, modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
hardware = {
|
||||
nvidia = {
|
||||
@@ -68,8 +69,14 @@
|
||||
};
|
||||
extraModulePackages = [ ];
|
||||
initrd = {
|
||||
availableKernelModules =
|
||||
[ "xhci_pci" "ahci" "usbhid" "nvme" "usb_storage" "sd_mod" ];
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
kernelModules = [ ];
|
||||
};
|
||||
};
|
||||
@@ -129,7 +136,10 @@
|
||||
};
|
||||
"/mnt/jellyfin/media" = {
|
||||
device = "/mnt/pool/multimedia/media";
|
||||
options = [ "bind" "ro" ];
|
||||
options = [
|
||||
"bind"
|
||||
"ro"
|
||||
];
|
||||
depends = [ "/mnt/pool" ];
|
||||
};
|
||||
# NFS
|
||||
@@ -154,13 +164,15 @@
|
||||
'';
|
||||
};
|
||||
};
|
||||
swapDevices = [{
|
||||
device = "/dev/disk/by-partuuid/cb0ad486-ebf8-4bfc-ad7c-96bdc68576ca";
|
||||
randomEncryption = {
|
||||
enable = true;
|
||||
cipher = "aes-xts-plain64";
|
||||
keySize = 512;
|
||||
sectorSize = 4096;
|
||||
};
|
||||
}];
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/dev/disk/by-partuuid/cb0ad486-ebf8-4bfc-ad7c-96bdc68576ca";
|
||||
randomEncryption = {
|
||||
enable = true;
|
||||
cipher = "aes-xts-plain64";
|
||||
keySize = 512;
|
||||
sectorSize = 4096;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../base.nix
|
||||
@@ -53,20 +54,24 @@
|
||||
};
|
||||
networking = {
|
||||
hostName = "workstation";
|
||||
firewall = let
|
||||
openPorts = [
|
||||
6674 # ns-usbloader
|
||||
];
|
||||
openPortRanges = [{
|
||||
from = 1714; # kdeconnect
|
||||
to = 1764; # kdeconnect
|
||||
}];
|
||||
in {
|
||||
allowedTCPPorts = openPorts;
|
||||
allowedUDPPorts = openPorts;
|
||||
allowedTCPPortRanges = openPortRanges;
|
||||
allowedUDPPortRanges = openPortRanges;
|
||||
};
|
||||
firewall =
|
||||
let
|
||||
openPorts = [
|
||||
6674 # ns-usbloader
|
||||
];
|
||||
openPortRanges = [
|
||||
{
|
||||
from = 1714; # kdeconnect
|
||||
to = 1764; # kdeconnect
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
allowedTCPPorts = openPorts;
|
||||
allowedUDPPorts = openPorts;
|
||||
allowedTCPPortRanges = openPortRanges;
|
||||
allowedUDPPortRanges = openPortRanges;
|
||||
};
|
||||
};
|
||||
nix.settings.cores = 16;
|
||||
nixpkgs = {
|
||||
@@ -132,8 +137,7 @@
|
||||
enable = true;
|
||||
useUpnp = true;
|
||||
enableWebUI = true;
|
||||
httpPass =
|
||||
"Uplifting-Proofs-Eggshell-Molecule-Wriggly-Janitor3-Padded-Oxidizing";
|
||||
httpPass = "Uplifting-Proofs-Eggshell-Molecule-Wriggly-Janitor3-Padded-Oxidizing";
|
||||
deviceName = "Oversweet3834";
|
||||
httpLogin = "Oversweet3834";
|
||||
httpListenPort = 9876;
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
{ config, modulesPath, lib, ... }: {
|
||||
{
|
||||
config,
|
||||
modulesPath,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
hardware = {
|
||||
cpu.amd.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
settings.General = {
|
||||
@@ -45,8 +50,14 @@
|
||||
};
|
||||
initrd = {
|
||||
secrets."/keyfile" = /etc/keyfile;
|
||||
availableKernelModules =
|
||||
[ "xhci_pci" "ahci" "usbhid" "nvme" "usb_storage" "sd_mod" ];
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
luks.devices.nvme = {
|
||||
device = "/dev/disk/by-uuid/e9618e85-a631-4374-b2a4-22c376d6e41b";
|
||||
keyFile = "/keyfile";
|
||||
@@ -54,50 +65,58 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
fileSystems = let
|
||||
nfsMount = server: nfsDisk: {
|
||||
device = "${server}:/${nfsDisk}";
|
||||
fsType = "nfs";
|
||||
options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ];
|
||||
};
|
||||
btrfsMount = subvol: {
|
||||
device = "/dev/mapper/nvme";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=${subvol}"
|
||||
"ssd"
|
||||
"compress=lzo"
|
||||
"x-systemd.device-timeout=0"
|
||||
"space_cache=v2"
|
||||
"commit=120"
|
||||
"datacow"
|
||||
] ++ (if subvol == "nixos" then [ "noatime" ] else [ ]);
|
||||
};
|
||||
in {
|
||||
"/" = btrfsMount "nixos" // { };
|
||||
"/home" = btrfsMount "home" // { };
|
||||
"/mnt/games" = btrfsMount "games" // { };
|
||||
"/mnt/miniserver/pool" = nfsMount "miniserver" "pool" // { };
|
||||
"/mnt/miniserver/jawz" = nfsMount "miniserver" "jawz" // { };
|
||||
"/mnt/server/pool" = nfsMount "server" "pool" // { };
|
||||
"/mnt/server/jawz" = nfsMount "server" "jawz" // { };
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/ac6d349a-96b9-499e-9009-229efd7743a5";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/B05D-B5FB";
|
||||
fsType = "vfat";
|
||||
};
|
||||
fileSystems =
|
||||
let
|
||||
nfsMount = server: nfsDisk: {
|
||||
device = "${server}:/${nfsDisk}";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"x-systemd.idle-timeout=600"
|
||||
];
|
||||
};
|
||||
btrfsMount = subvol: {
|
||||
device = "/dev/mapper/nvme";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=${subvol}"
|
||||
"ssd"
|
||||
"compress=lzo"
|
||||
"x-systemd.device-timeout=0"
|
||||
"space_cache=v2"
|
||||
"commit=120"
|
||||
"datacow"
|
||||
] ++ (if subvol == "nixos" then [ "noatime" ] else [ ]);
|
||||
};
|
||||
in
|
||||
{
|
||||
"/" = btrfsMount "nixos" // { };
|
||||
"/home" = btrfsMount "home" // { };
|
||||
"/mnt/games" = btrfsMount "games" // { };
|
||||
"/mnt/miniserver/pool" = nfsMount "miniserver" "pool" // { };
|
||||
"/mnt/miniserver/jawz" = nfsMount "miniserver" "jawz" // { };
|
||||
"/mnt/server/pool" = nfsMount "server" "pool" // { };
|
||||
"/mnt/server/jawz" = nfsMount "server" "jawz" // { };
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/ac6d349a-96b9-499e-9009-229efd7743a5";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/B05D-B5FB";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
};
|
||||
swapDevices = [{
|
||||
device = "/dev/disk/by-partuuid/c1bd22d7-e62c-440a-88d1-6464be1aa1b0";
|
||||
randomEncryption = {
|
||||
enable = true;
|
||||
cipher = "aes-xts-plain64";
|
||||
keySize = 512;
|
||||
sectorSize = 4096;
|
||||
};
|
||||
}];
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/dev/disk/by-partuuid/c1bd22d7-e62c-440a-88d1-6464be1aa1b0";
|
||||
randomEncryption = {
|
||||
enable = true;
|
||||
cipher = "aes-xts-plain64";
|
||||
keySize = 512;
|
||||
sectorSize = 4096;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user