diff options
Diffstat (limited to 'modules/root')
| -rw-r--r-- | modules/root/default.nix | 2 | ||||
| -rw-r--r-- | modules/root/nas.nix | 29 | ||||
| -rw-r--r-- | modules/root/software/desktop.nix | 1 | 
3 files changed, 21 insertions, 11 deletions
| diff --git a/modules/root/default.nix b/modules/root/default.nix index c3d2dc1..e108318 100644 --- a/modules/root/default.nix +++ b/modules/root/default.nix @@ -31,7 +31,9 @@  	nas = {  		enable             = lib.mkDefault false;  		home.enable        = lib.mkDefault true; +		home.automount     = lib.mkDefault false;  		office.enable      = lib.mkDefault false; +		office.automount   = lib.mkDefault false;  	};  	bootloader = {  		mode               = lib.mkDefault "bios"; diff --git a/modules/root/nas.nix b/modules/root/nas.nix index 0e11196..525456e 100644 --- a/modules/root/nas.nix +++ b/modules/root/nas.nix @@ -1,29 +1,36 @@  { lib, config, ... } :  let -	mkNetworkFileSystem = device : { +	mkNetworkFileSystem = device: automount: {  		device = "${device}";  		fsType = "nfs"; -		options = [ "noauto" "defaults" ]; +		options = [ "defaults" ] ++ lib.optionals automount [ "noauto" ];  	};  in {  	options = {  		nas = {  			enable = lib.mkEnableOption "enable network shares"; -			home.enable = lib.mkEnableOption "enable home network shares"; -			office.enable = lib.mkEnableOption "enable office network shares"; +			home = { +				enable = lib.mkEnableOption "enable home network shares"; +				automount = lib.mkEnableOption "automount home network shares"; +			}; +			office = { +				enable = lib.mkEnableOption "enable office network shares"; +				automount = lib.mkEnableOption "automount home network shares"; +			};  		};  	};  	config = lib.mkIf config.nas.enable {  		fileSystems = lib.optionalAttrs config.nas.home.enable { -			"/media/Storage/Media"   = mkNetworkFileSystem "truenas-home:/mnt/Storage/Media"; -			"/media/Storage/Backups" = mkNetworkFileSystem "truenas-home:/mnt/Storage/Backups"; -			"/media/Storage/Tapes"   = mkNetworkFileSystem "truenas-home:/mnt/Storage/Backups/Tapes"; -			"/media/Family Photos"   = mkNetworkFileSystem "truenas-home:/mnt/Media/Photos"; +			"/media/Storage/Media"   = mkNetworkFileSystem "truenas-home:/mnt/Storage/Media"               config.nas.home.automount; +			"/media/Storage/Backups" = mkNetworkFileSystem "truenas-home:/mnt/Storage/Backups"             config.nas.home.automount; +			"/media/Storage/Tapes"   = mkNetworkFileSystem "truenas-home:/mnt/Storage/Backups/Tapes"       config.nas.home.automount; +			"/media/Family Photos"   = mkNetworkFileSystem "truenas-home:/mnt/Media/Photos"                config.nas.home.automount;  		} // lib.optionalAttrs config.nas.office.enable { -			"/media/chexx/chexx"     = mkNetworkFileSystem "truenas-office:/mnt/Storage/chexx"; -			"/media/chexx/tkdocs"    = mkNetworkFileSystem "truenas-office:/mnt/Storage/Users/Tim-Keller"; -			"/media/chexx/scans"     = mkNetworkFileSystem "truenas-office:/mnt/Storage/Scans"; +			"/media/chexx/chexx"     = mkNetworkFileSystem "truenas-office:/mnt/Storage/chexx"             config.nas.office.automount; +			"/media/chexx/tkdocs"    = mkNetworkFileSystem "truenas-office:/mnt/Storage/Users/Tim-Keller"  config.nas.office.automount; +			"/media/chexx/scans"     = mkNetworkFileSystem "truenas-office:/mnt/Storage/Scans"             config.nas.office.automount;  		}; +		# TODO auto mkdirz  	};  } diff --git a/modules/root/software/desktop.nix b/modules/root/software/desktop.nix index eb0a5ff..4f7aca9 100644 --- a/modules/root/software/desktop.nix +++ b/modules/root/software/desktop.nix @@ -55,6 +55,7 @@  			inkscape  		] ++ pkgs.lib.optionals config.software.desktop.office.enable [  			# Office +			libreoffice  			thunderbird  		] ++ pkgs.lib.optionals config.software.desktop.utilities.enable [  			# Misc Utilities | 
