FEATURE: add bind mounts for homeshare

- mount homeshare directories to media from homeshareDataLocation in configVars
This commit is contained in:
Sam 2025-01-19 10:30:46 +00:00
parent 6e236ff544
commit 82b89bd6d0
15 changed files with 81 additions and 11 deletions

View File

@ -26,7 +26,6 @@
pkgs.hunspellDicts.en_US pkgs.hunspellDicts.en_US
pkgs.set_wm_class pkgs.set_wm_class
pkgs.xorg.xkill pkgs.xorg.xkill
pkgs.krita
pkgs.R pkgs.R
pkgs.gimp pkgs.gimp
pkgs.gajim pkgs.gajim

View File

@ -48,9 +48,11 @@ in {
../common/optional/pipewire.nix ../common/optional/pipewire.nix
../common/optional/openssh.nix ../common/optional/openssh.nix
../common/optional/dwm.nix ../common/optional/dwm.nix
../common/optional/nfs-mounts/media.nix
../common/optional/nfs-mounts/homeshare.nix # ../common/optional/fileserver/media.nix
../common/optional/nfs-mounts/photos.nix # ../common/optional/fileserver/homeshare.nix
# ../common/optional/fileserver/photos.nix
../common/optional/printing.nix ../common/optional/printing.nix
../common/optional/backlight.nix ../common/optional/backlight.nix
../common/optional/xmodmap-arrow-remaps.nix ../common/optional/xmodmap-arrow-remaps.nix

View File

@ -0,0 +1,13 @@
{configVars, ...}: let
homeshareDataLocation = configVars.locations.homeshareDataLocation;
in
{
fileSystems."/media/media" = {
device = "${homeshareDataLocation}/media";
fsType = "none";
options = [ "bind" ];
};
}

View File

@ -0,0 +1,13 @@
{configVars, ...}: let
homeshareDataLocation = configVars.locations.homeshareDataLocation;
in
{
fileSystems."/media/personal" = {
device = "${homeshareDataLocation}/personal";
fsType = "none";
options = [ "bind" ];
};
}

View File

@ -0,0 +1,13 @@
{configVars, ...}: let
homeshareDataLocation = configVars.locations.homeshareDataLocation;
in
{
fileSystems."/media/photos" = {
device = "${homeshareDataLocation}/photos";
fsType = "none";
options = [ "bind" ];
};
}

View File

@ -0,0 +1,9 @@
{
fileSystems."/media/homeshare" = {
device = "10.0.10.30:/mnt/homeshare";
fsType = "nfs";
options = [ "noatime" "_netdev" ];
};
}

View File

@ -0,0 +1,9 @@
{configVars, ...}: let
mediaDataMountPoint = configVars.locations.mediaDataMountPoint;
in {
fileSystems.${mediaDataMountPoint} = {
device = "10.0.10.30:/mnt/media";
fsType = "nfs";
options = ["noatime" "_netdev"];
};
}

View File

@ -0,0 +1,9 @@
{configVars, ...}: let
photosDataMountPoint = configVars.locations.photosDataMountPoint;
in {
fileSystems.${photosDataMountPoint} = {
device = "10.0.10.30:/mnt/photos";
fsType = "nfs";
options = ["noatime" "_netdev" "ro"];
};
}

View File

@ -78,7 +78,7 @@ in {
useHostResolvConf = lib.mkForce false; useHostResolvConf = lib.mkForce false;
}; };
services.resolved.enable = true; services.resolved.enable = false;
imports = [ imports = [
arion.nixosModules.arion arion.nixosModules.arion
@ -89,6 +89,7 @@ in {
pkgs.vim pkgs.vim
pkgs.git pkgs.git
pkgs.arion pkgs.arion
pkgs.lsof
]; ];
virtualisation = { virtualisation = {

View File

@ -54,10 +54,10 @@ in {
../common/optional/gaming.nix ../common/optional/gaming.nix
../common/optional/restic-backup.nix ../common/optional/restic-backup.nix
# nfs mounts # bind mounts
../common/optional/nfs-mounts/media.nix ../common/optional/fileserver/bind-mounts/media.nix
../common/optional/nfs-mounts/homeshare.nix ../common/optional/fileserver/bind-mounts/personal.nix
../common/optional/nfs-mounts/photos.nix ../common/optional/fileserver/bind-mounts/photos.nix
# nixos-containers # nixos-containers
../common/optional/nixos-containers/nix-bitcoin.nix ../common/optional/nixos-containers/nix-bitcoin.nix
@ -66,7 +66,7 @@ in {
../common/optional/nixos-containers/semitamaps-worker.nix ../common/optional/nixos-containers/semitamaps-worker.nix
../common/optional/nixos-containers/backup-server.nix ../common/optional/nixos-containers/backup-server.nix
../common/optional/nixos-containers/docker.nix ../common/optional/nixos-containers/docker.nix
# ../common/optional/nixos-containers/pihole.nix ../common/optional/nixos-containers/pihole.nix
../common/optional/nixos-containers/metrics-server.nix ../common/optional/nixos-containers/metrics-server.nix
# # Build nix derivations on remote machine # # Build nix derivations on remote machine

View File

@ -44,7 +44,7 @@ in {
# Import optional options # Import optional options
../common/optional/openssh.nix ../common/optional/openssh.nix
../common/optional/persistence.nix ../common/optional/persistence.nix
../common/optional/nfs-mounts/media.nix # ../common/optional/fileserver/media.nix
../common/optional/gaming.nix ../common/optional/gaming.nix
../common/optional/printing.nix ../common/optional/printing.nix
outputs.nixosModules.nixosAutoUpgrade outputs.nixosModules.nixosAutoUpgrade

View File

@ -7,6 +7,8 @@
locations = { locations = {
mediaDataMountPoint = "/media/media"; mediaDataMountPoint = "/media/media";
photosDataMountPoint = "/media/photos"; photosDataMountPoint = "/media/photos";
personalDataMountPoint = "/media/personal";
homeshareDataLocation = "/mnt/main-ssd/homeshare";
metricsServerContainerData = "/mnt/main-ssd/metrics-server"; metricsServerContainerData = "/mnt/main-ssd/metrics-server";
dockerContainerData = "/mnt/main-ssd/docker"; dockerContainerData = "/mnt/main-ssd/docker";