move nas to internal ssd

This commit is contained in:
mjallen18
2024-02-21 13:47:45 -06:00
parent b599645fd9
commit c3d1e2f962
10 changed files with 82 additions and 42 deletions

View File

@@ -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;