move nas to internal ssd
This commit is contained in:
@@ -22,6 +22,7 @@ in
|
||||
./nas-apps/mariadb.nix
|
||||
./nas-apps/nextcloud.nix
|
||||
./nas-apps/collabora.nix
|
||||
./nas-apps/jellyseerr.nix
|
||||
];
|
||||
|
||||
# Enable nix flakes and nix-command tools
|
||||
@@ -54,6 +55,7 @@ in
|
||||
supportedFilesystems = [ "zfs" ];
|
||||
|
||||
zfs.extraPools = [ "junk" ];
|
||||
zfs.requestEncryptionCredentials = false;
|
||||
};
|
||||
|
||||
# Hardware configs
|
||||
@@ -176,17 +178,20 @@ in
|
||||
systemd.services.nas-mounts = {
|
||||
path = [ pkgs.zfs pkgs.bash ];
|
||||
script = ''
|
||||
if test -d /mnt/Safe\ SSD/ssd_app_data; then
|
||||
if test -d /mnt/ssd/ssd_app_data; then
|
||||
echo "NAS ZFS Pools Mounted."
|
||||
else
|
||||
zpool import -R /mnt -f "Main Pool"
|
||||
zpool import -R /mnt -f "Safe SSD"
|
||||
zfs load-key -L file:///root/main-pool.key "Main Pool"
|
||||
zfs load-key -L file:///root/safe-ssd.key "Safe SSD"
|
||||
zpool import -f "MainPool"
|
||||
zpool import -f "SSD"
|
||||
zfs load-key -L file:///root/main-pool.key "MainPool"
|
||||
zfs load-key -L file:///root/ssd.key "SSD"
|
||||
zfs mount -a
|
||||
echo "NAS ZFS Pools Mounted."
|
||||
fi
|
||||
'';
|
||||
# after = [ "zfs-import.target" ];
|
||||
# before = [ "zfs-mount.service" ];
|
||||
# wantedBy = [ "zfs-mount.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
@@ -199,6 +204,11 @@ in
|
||||
# Enable Network Manager
|
||||
networkmanager.enable = true;
|
||||
|
||||
# interfaces.enp7s0.ipv4.addresses = [ {
|
||||
# address = "10.0.1.18";
|
||||
# prefixLength = 24;
|
||||
# } ];
|
||||
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowPing = true;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "mpt3sas" "xhci_pci" "ahci" "usb_storage" "uas" "sd_mod" ];
|
||||
boot.initrd.availableKernelModules = [ "nvme" "mpt3sas" "xhci_pci" "ahci" "uas" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
@@ -19,48 +19,61 @@
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/CDC4-6ECC";
|
||||
{ device = "/dev/disk/by-uuid/C6E9-7371";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
fileSystems."/nix" =
|
||||
{ device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7";
|
||||
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nix" ];
|
||||
options = [ "subvol=nix" "compress-force=zstd" "noatime" ];
|
||||
};
|
||||
|
||||
fileSystems."/etc" =
|
||||
{ device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7";
|
||||
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=etc" ];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" =
|
||||
{ device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=log" ];
|
||||
options = [ "subvol=etc" "compress-force=zstd" "noatime" ];
|
||||
};
|
||||
|
||||
fileSystems."/root" =
|
||||
{ device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7";
|
||||
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=root" ];
|
||||
options = [ "subvol=root" "compress-force=zstd" "noatime" ];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" =
|
||||
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=log" "compress-force=zstd" "noatime" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{ device = "/dev/disk/by-uuid/b7ba8986-8291-434a-ae9b-dcfcdfe01ad7";
|
||||
{ device = "/dev/disk/by-uuid/85e2fa30-816f-4457-80a1-9f88b9ab77b3";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
options = [ "subvol=home" "compress-force=zstd"];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/c08ba901-a8a9-4006-9688-002bb24da1b6"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.docker0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp7s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.podman0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth2.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth3.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth4.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth5.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth6.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.veth7.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.vethd3ca67e.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
|
||||
@@ -56,9 +56,9 @@
|
||||
-e 'NVIDIA_DRIVER_CAPABILITIES'='all' \
|
||||
-e 'NVIDIA_VISIBLE_DEVICES'='all' \
|
||||
-p 8096:8096 \
|
||||
-v '/mnt/jellyfin/jellyfin:/config' \
|
||||
-v '/mnt/movies/Movies:/data/movies' \
|
||||
-v '/mnt/tv/TV:/data/tv' \
|
||||
-v '/mnt/ssd/nix-app-data/jellyfin:/config' \
|
||||
-v '/mnt/mainpool/Movies:/data/movies' \
|
||||
-v '/mnt/mainpool/TV:/data/tv' \
|
||||
lscr.io/linuxserver/jellyfin:latest
|
||||
'';
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
17
nas-apps/jellyseerr.nix
Normal file
17
nas-apps/jellyseerr.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
# jellyseerr
|
||||
virtualisation.oci-containers.containers."jellyseerr" = {
|
||||
autoStart = true;
|
||||
image = "fallenbagel/jellyseerr";
|
||||
ports = [ "5055:5055" ];
|
||||
volumes = [
|
||||
"/mnt/ssd/ssd_app_data/jellyseerr:/config"
|
||||
];
|
||||
environment = {
|
||||
PUID = "911";
|
||||
PGID = "1000";
|
||||
TZ = "America/Chicago";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
image = "linuxserver/mariadb";
|
||||
ports = [ "3306:3306" ];
|
||||
volumes = [
|
||||
"/mnt/Safe\ SSD/mariadb:/config"
|
||||
"/mnt/ssd/mariadb:/config"
|
||||
];
|
||||
environment = {
|
||||
PUID = "911";
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
virtualisation.oci-containers.containers."nextcloud" = {
|
||||
autoStart = true;
|
||||
image = "linuxserver/nextcloud";
|
||||
ports = [ "9443:443" ];
|
||||
ports = [ "9443:443" "9880:80" ];
|
||||
volumes = [
|
||||
"/mnt/Safe\ SSD/ssd_app_data/nextcloud:/config"
|
||||
"/mnt/Main\ Pool/Nextcloud:/data"
|
||||
"/mnt/ssd/ssd_app_data/nextcloud:/config"
|
||||
"/mnt/mainpool/Nextcloud:/data"
|
||||
];
|
||||
environment = {
|
||||
PUID = "911";
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
image = "linuxserver/radarr";
|
||||
ports = [ "7878:7878" ];
|
||||
volumes = [
|
||||
"/mnt/Safe\ SSD/ssd_app_data/radarr:/config"
|
||||
"/mnt/Main\ Pool/Movies:/movies"
|
||||
"/mnt/Safe\ SSD/ssd_app_data/downloads:/downloads"
|
||||
"/mnt/ssd/ssd_app_data/radarr:/config"
|
||||
"/mnt/mainpool/Movies:/movies"
|
||||
"/mnt/ssd/ssd_app_data/downloads:/downloads"
|
||||
];
|
||||
environment = {
|
||||
PUID = "911";
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
image = "linuxserver/sabnzbd";
|
||||
ports = [ "8080:8080" ];
|
||||
volumes = [
|
||||
"/mnt/Safe\ SSD/ssd_app_data/sabnzbd:/config"
|
||||
"/mnt/Main\ Pool/TV:/tv"
|
||||
"/mnt/Main\ Pool/Movies:/movies"
|
||||
"/mnt/Safe\ SSD/ssd_app_data/downloads:/downloads"
|
||||
"/mnt/Safe\ SSD/ssd_app_data/downloads-incomplete:/downloads-incomplete"
|
||||
"/mnt/ssd/ssd_app_data/sabnzbd:/config"
|
||||
"/mnt/mainpool/TV:/tv"
|
||||
"/mnt/mainpool/Movies:/movies"
|
||||
"/mnt/ssd/ssd_app_data/downloads:/downloads"
|
||||
"/mnt/ssd/ssd_app_data/downloads-incomplete:/downloads-incomplete"
|
||||
];
|
||||
environment = {
|
||||
PUID = "911";
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
image = "linuxserver/sonarr";
|
||||
ports = [ "8989:8989" ];
|
||||
volumes = [
|
||||
"/mnt/Safe\ SSD/ssd_app_data/sonarr:/config"
|
||||
"/mnt/Main\ Pool/TV:/tv"
|
||||
"/mnt/Safe\ SSD/ssd_app_data/downloads:/downloads"
|
||||
"/mnt/ssd/ssd_app_data/sonarr:/config"
|
||||
"/mnt/mainpool/TV:/tv"
|
||||
"/mnt/ssd/ssd_app_data/downloads:/downloads"
|
||||
];
|
||||
environment = {
|
||||
PUID = "911";
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
image = "linuxserver/swag";
|
||||
ports = [ "80:80" "443:443" ];
|
||||
volumes = [
|
||||
"/mnt/Safe\ SSD/ssd_app_data/swag:/config"
|
||||
"/mnt/ssd/ssd_app_data/swag:/config"
|
||||
];
|
||||
environment = {
|
||||
PGID = "1000";
|
||||
@@ -15,7 +15,7 @@
|
||||
TZ = "America/Chicago";
|
||||
URL = "mjallen.dev";
|
||||
VALIDATION = "http";
|
||||
SUBDOMAINS = "jellyfin,hass,cloud,jellyseer";
|
||||
SUBDOMAINS = "jellyfin,hass,cloud,office,jellyseerr";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user