mirror of
https://github.com/tboerger/nixos-config
synced 2024-11-22 18:21:58 +01:00
chore: more fixes to filesystem creation
This commit is contained in:
parent
288ad45237
commit
0b41b207ad
@ -91,15 +91,6 @@
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/var/lib/media/downloads" = {
|
||||
device = "/dev/disk/by-label/downloads";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/var/lib/printer" = {
|
||||
device = "/dev/disk/by-label/printer";
|
||||
fsType = "ext4";
|
||||
|
@ -14,6 +14,7 @@
|
||||
./media.nix
|
||||
./nixbuild.nix
|
||||
./openssh.nix
|
||||
./samba.nix
|
||||
./tailscale.nix
|
||||
./timesyncd.nix
|
||||
./webserver.nix
|
||||
|
@ -151,19 +151,6 @@ in
|
||||
"valid users" = "media";
|
||||
};
|
||||
|
||||
downloads = {
|
||||
comment = "Shared downloads";
|
||||
path = "/var/lib/media/downloads";
|
||||
|
||||
"browseable" = "no";
|
||||
"read only" = "no";
|
||||
"writeable" = "yes";
|
||||
"guest ok" = "no";
|
||||
"force user" = "media";
|
||||
"force group" = "media";
|
||||
"valid users" = "media";
|
||||
};
|
||||
|
||||
printer = {
|
||||
comment = "Shared printer";
|
||||
path = "/var/lib/printer";
|
||||
|
@ -128,6 +128,17 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/var/lib/media/downloads" = {
|
||||
device = "/dev/disk/by-label/downloads";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
|
||||
fileSystems."/var/lib/media/movies" = {
|
||||
device = "/dev/disk/by-label/movies";
|
||||
fsType = "ext4";
|
||||
@ -188,21 +199,6 @@ in
|
||||
# options = cifsOptions;
|
||||
# };
|
||||
|
||||
fileSystems."/var/lib/media/downloads" = {
|
||||
device = "/dev/disk/by-label/downloads";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
};
|
||||
|
||||
# fileSystems."/var/lib/media/downloads" = {
|
||||
# device = "${cifsServer}/downloads";
|
||||
# fsType = "cifs";
|
||||
# options = cifsOptions;
|
||||
# };
|
||||
|
||||
age.secrets."users/media/smbpasswd" = {
|
||||
file = ../../secrets/users/media/smbpasswd.age;
|
||||
};
|
||||
|
@ -181,17 +181,6 @@ mkdir -p /mnt/var/lib/media/music
|
||||
mount -t ext4 /dev/tank/music /mnt/var/lib/media/music
|
||||
chown 20000:20000 /mnt/var/lib/media/music
|
||||
|
||||
echo "-----> Create downloads volume"
|
||||
lvcreate --size 100G --name downloads tank
|
||||
|
||||
echo "-----> Create downloads filesystem"
|
||||
mkfs.ext4 -L downloads /dev/tank/downloads
|
||||
|
||||
echo "-----> Mount downloads filesystem"
|
||||
mkdir -p /mnt/var/lib/media/downloads
|
||||
mount -t ext4 /dev/tank/downloads /mnt/var/lib/media/downloads
|
||||
chown 20000:20000 /mnt/var/lib/media/downloads
|
||||
|
||||
echo "-----> Create printer volume"
|
||||
lvcreate --size 5G --name printer tank
|
||||
|
||||
|
@ -82,6 +82,18 @@ echo "-----> Mount boot filesystem"
|
||||
mkdir /mnt/boot
|
||||
mount /dev/disk/by-label/boot /mnt/boot
|
||||
|
||||
for PARTITION in acme nzbget jellyfin bazarr lidarr prowlarr radarr readarr sonarr; do
|
||||
echo "-----> Create ${PARTITION} volume"
|
||||
lvcreate --size 5G --name ${PARTITION} system
|
||||
|
||||
echo "-----> Create ${PARTITION} filesystem"
|
||||
mkfs.ext4 -L ${PARTITION} /dev/system/${PARTITION}
|
||||
|
||||
echo "-----> Mount ${PARTITION} filesystem"
|
||||
mkdir /mnt/var/lib/${PARTITION}
|
||||
mount -t ext4 /dev/system/${PARTITION} /mnt/var/lib/${PARTITION}
|
||||
done
|
||||
|
||||
echo "-----> Create tank partition"
|
||||
sgdisk -n 0:0:0 -t 0:8300 -c 0:tank /dev/sdb
|
||||
|
||||
@ -92,68 +104,12 @@ echo "-----> Create tank vg"
|
||||
vgcreate tank /dev/disk/by-partlabel/tank
|
||||
|
||||
echo "-----> Create downloads volume"
|
||||
lvcreate --size 50G --name downloads tank
|
||||
lvcreate --size 200G --name downloads tank
|
||||
|
||||
echo "-----> Create downloads filesystem"
|
||||
mkfs.ext4 -L downloads /dev/tank/downloads
|
||||
|
||||
echo "-----> Mount downloads filesystem"
|
||||
mkdir -p /var/lib/media/downloads
|
||||
mount -t ext4 /dev/tank/downloads /var/lib/media/downloads
|
||||
chown 20000:20000 /var/lib/media/downloads
|
||||
|
||||
echo "-----> Create movies volume"
|
||||
lvcreate --size 200G --name movies tank
|
||||
|
||||
echo "-----> Create movies filesystem"
|
||||
mkfs.ext4 -L movies /dev/tank/movies
|
||||
|
||||
echo "-----> Mount movies filesystem"
|
||||
mkdir -p /var/lib/media/movies
|
||||
mount -t ext4 /dev/tank/movies /var/lib/media/movies
|
||||
chown 20000:20000 /var/lib/media/movies
|
||||
|
||||
echo "-----> Create series volume"
|
||||
lvcreate --size 300G --name series tank
|
||||
|
||||
echo "-----> Create series filesystem"
|
||||
mkfs.ext4 -L series /dev/tank/series
|
||||
|
||||
echo "-----> Mount series filesystem"
|
||||
mkdir -p /var/lib/media/series
|
||||
mount -t ext4 /dev/tank/series /var/lib/media/series
|
||||
chown 20000:20000 /var/lib/media/series
|
||||
|
||||
echo "-----> Create books volume"
|
||||
lvcreate --size 50G --name books tank
|
||||
|
||||
echo "-----> Create books filesystem"
|
||||
mkfs.ext4 -L books /dev/tank/books
|
||||
|
||||
echo "-----> Mount books filesystem"
|
||||
mkdir -p /var/lib/media/books
|
||||
mount -t ext4 /dev/tank/books /var/lib/media/books
|
||||
chown 20000:20000 /var/lib/media/books
|
||||
|
||||
echo "-----> Create music volume"
|
||||
lvcreate --size 50G --name music tank
|
||||
|
||||
echo "-----> Create music filesystem"
|
||||
mkfs.ext4 -L music /dev/tank/music
|
||||
|
||||
echo "-----> Mount music filesystem"
|
||||
mkdir -p /var/lib/media/music
|
||||
mount -t ext4 /dev/tank/music /var/lib/media/music
|
||||
chown 20000:20000 /var/lib/media/music
|
||||
|
||||
for PARTITION in acme nzbget jellyfin bazarr lidarr prowlarr radarr readarr sonarr; do
|
||||
echo "-----> Create ${PARTITION} volume"
|
||||
lvcreate --size 5G --name ${PARTITION} system
|
||||
|
||||
echo "-----> Create ${PARTITION} filesystem"
|
||||
mkfs.ext4 -L ${PARTITION} /dev/system/${PARTITION}
|
||||
|
||||
echo "-----> Mount ${PARTITION} filesystem"
|
||||
mkdir /var/lib/${PARTITION}
|
||||
mount -t ext4 /dev/system/${PARTITION} /var/lib/${PARTITION}
|
||||
done
|
||||
mkdir -p /mnt/var/lib/media/downloads
|
||||
mount -t ext4 /dev/tank/downloads /mnt/var/lib/media/downloads
|
||||
chown 20000:20000 /mnt/var/lib/media/downloads
|
||||
|
Loading…
Reference in New Issue
Block a user