commit 1c22e3904219db2628d374d65036c1a22a42283d
parent 4e298570fd517f4dc7cba0a0bd280f6244d7e223
Author: breadcat <breadcat@users.noreply.github.com>
Date: Wed, 6 Aug 2025 12:27:57 +0100
Move mnt to tank
Conditionally mount volumes too
Diffstat:
17 files changed, 47 insertions(+), 54 deletions(-)
diff --git a/common/mount-drives.nix b/common/mount-drives.nix
@@ -0,0 +1,31 @@
+{ lib, ... }:
+
+let
+ nixbootExists = builtins.pathExists "/dev/disk/by-label/NIXBOOT";
+ tankExists = builtins.pathExists "/dev/disk/by-label/TANK";
+in
+{
+ fileSystems = lib.mkMerge [
+
+ {
+ "/" = {
+ device = "/dev/disk/by-label/NIXROOT";
+ fsType = "ext4";
+ };
+ }
+
+ # Conditionally include filesystems
+ (lib.mkIf nixbootExists {
+ "/boot" = {
+ device = "/dev/disk/by-label/NIXBOOT";
+ fsType = "vfat";
+ };
+ })
+ (lib.mkIf tankExists {
+ "/tank" = {
+ device = "/dev/disk/by-label/TANK";
+ fsType = "ext4";
+ };
+ })
+ ];
+}
diff --git a/common/nfs.nix b/common/nfs.nix
@@ -1,6 +1,6 @@
{
- fileSystems."/mnt" = {
- device = "192.168.1.3:/mnt";
+ fileSystems."/tank" = {
+ device = "192.168.1.3:/tank";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
diff --git a/common/tank-sort.nix b/common/tank-sort.nix
@@ -5,9 +5,9 @@ let
# variables
temp_mount="$(mktemp -d)"
rclone_remote="seedbox:"
- destination_tvshows="/mnt/media/videos/television"
+ destination_tvshows="/tank/media/videos/television"
template_tvshows="{{ .Name }}/{{ .Name }} S{{ printf \"%02d\" .Season }}E{{ printf \"%02d\" .Episode }}{{ if ne .ExtraEpisode -1 }}-{{ printf \"%02d\" .ExtraEpisode }}{{end}}.{{ .Ext }}"
- destination_movies="/mnt/media/videos/movies"
+ destination_movies="/tank/media/videos/movies"
template_movies="{{ .Name }} ({{ .Year }})/{{ .Name }}.{{ .Ext }}"
# mount remote
${pkgs.rclone}/bin/rclone mount "$rclone_remote" "$temp_mount" --daemon
diff --git a/home/rclone.nix b/home/rclone.nix
@@ -29,7 +29,7 @@
};
nas.config = {
type = "alias";
- remote = "/mnt/media";
+ remote = "/tank/media";
};
myrient.config = {
type = "http";
diff --git a/machines/arcadia-hardware.nix b/machines/arcadia-hardware.nix
@@ -10,17 +10,6 @@
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/705ee72a-0cbf-40a3-a6cb-4ddd976b3d8f";
- fsType = "ext4";
- };
-
- fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/7D86-A86F";
- fsType = "vfat";
- options = [ "fmask=0077" "dmask=0077" ];
- };
-
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
diff --git a/machines/arcadia.nix b/machines/arcadia.nix
@@ -16,6 +16,7 @@ in
../common/flakes.nix
../common/garbage.nix
(import ../common/locale.nix {inherit config pkgs timezone;})
+ ../common/mount-drives.nix
../common/nfs.nix
# ../common/kodi-module.nix
../common/packages.nix
diff --git a/machines/artemis-hardware.nix b/machines/artemis-hardware.nix
@@ -10,17 +10,6 @@
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
- fileSystems."/" =
- { device = "/dev/disk/by-label/NIXROOT";
- fsType = "ext4";
- };
-
- fileSystems."/boot" =
- { device = "/dev/disk/by-label/NIXBOOT";
- fsType = "vfat";
- options = [ "fmask=0022" "dmask=0022" ];
- };
-
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
# Bootloader
diff --git a/machines/artemis.nix b/machines/artemis.nix
@@ -33,6 +33,7 @@ in {
../common/vnstat.nix
(import ../common/locale.nix {inherit pkgs timezone;})
(import ../common/magnets.nix {inherit pkgs username;})
+ ../common/mount-drives.nix
../common/packages.nix
(import ../common/restic.nix {inherit pkgs username;})
(import ../common/ssh.nix {inherit username sshkey sshport;})
diff --git a/machines/ilias-hardware.nix b/machines/ilias-hardware.nix
@@ -10,17 +10,6 @@
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/8018d8fb-dffe-40a2-b5f9-500000b24c36";
- fsType = "ext4";
- };
-
- fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/EE4D-E953";
- fsType = "vfat";
- options = [ "fmask=0077" "dmask=0077" ];
- };
-
swapDevices =
[ { device = "/dev/disk/by-uuid/3397e636-91db-44ae-9572-923e4b3acbbe"; }
];
diff --git a/machines/ilias.nix b/machines/ilias.nix
@@ -24,6 +24,7 @@ in {
../common/flakes.nix
../common/garbage.nix
(import ../common/locale.nix {inherit pkgs timezone;})
+ ../common/mount-drives.nix
../common/packages.nix
(import ../common/restic.nix {inherit pkgs username;})
(import ../common/ssh-tunnel.nix {inherit config pkgs username domain sshport privatekey;})
@@ -71,15 +72,11 @@ in {
# Hostname
networking.hostName = "ilias"; # Define your hostname.
- # Second drive and NFS
- fileSystems."/mnt" = {
- device = "/dev/disk/by-uuid/9b205675-7376-45ba-b575-2f36eb50ea99";
- fsType = "ext4";
- };
+ # NFS server
services.nfs.server = {
enable = true;
exports = ''
- /mnt 192.168.1.0/24(rw)
+ /tank 192.168.1.0/24(rw)
'';
};
# Firewall and NFS server ports
diff --git a/machines/minerva-hardware.nix b/machines/minerva-hardware.nix
@@ -10,11 +10,6 @@
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/e9802357-1ee2-4e24-bf94-580c96205012";
- fsType = "ext4";
- };
-
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
diff --git a/machines/minerva.nix b/machines/minerva.nix
@@ -24,6 +24,7 @@ in {
../common/fonts.nix
../common/garbage.nix
../common/locale.nix
+ ../common/mount-drives.nix
../common/nfs.nix
../common/packages.nix
(import ../common/restic.nix {inherit pkgs username;})
diff --git a/scripts/audiobook-cleaner.nix b/scripts/audiobook-cleaner.nix
@@ -6,7 +6,7 @@
audiobook-cleaner = pkgs.writeShellScriptBin "audiobook-cleaner" ''
# variables
list_file="$HOME/vault/src/blog.${domain}/content/reading-list.md"
- media_dir="/mnt/media/literature/audiobooks"
+ media_dir="/tank/media/literature/audiobooks"
trim() {
local var="$*"
diff --git a/scripts/backup-local.nix b/scripts/backup-local.nix
@@ -5,7 +5,7 @@
}: let
backup-local = pkgs.writeShellScriptBin "backup-local" ''
# variables
- mount_points=("/mnt/" "/usb/")
+ mount_points=("/tank/" "/usb/")
report_file=("''${mount_points[1]}reports/$(date +"%Y-%m-%d_%H-%M").log")
# checks
for dir in "''${mount_points[@]}"; do
diff --git a/scripts/duupmove.nix b/scripts/duupmove.nix
@@ -4,7 +4,7 @@
target_dir="$1"
if [ -z "$target_dir" ]; then
- echo "Target directory variable is empty. Please specify a directory, e.g. /mnt/destination/"
+ echo "Target directory variable is empty. Please specify a directory, e.g. ~/destination/"
exit 1
fi
diff --git a/scripts/payslips.nix b/scripts/payslips.nix
@@ -3,7 +3,7 @@
let
payslips = pkgs.writeShellScriptBin "payslips" ''
# Default destination directory, or use argument
- destination_default="/mnt/paperwork/personal/workplace/wages"
+ destination_default="/tank/paperwork/personal/workplace/wages"
destination_dir="''${1:-$destination_default}"
# Process matching files
diff --git a/scripts/phone-dump.nix b/scripts/phone-dump.nix
@@ -2,7 +2,7 @@
phone-dump = pkgs.writeShellScriptBin "phone-dump" ''
# variables
phone_remote=phone
- destination="/mnt/pictures/personal"
+ destination="/tank/pictures/personal"
if [ ! -d "$destination" ]; then
echo "Destination $destination does not exist."
exit 1