diff --git a/hosts/by-name/desko/fs.nix b/hosts/by-name/desko/fs.nix index 7f22679af..22db863be 100644 --- a/hosts/by-name/desko/fs.nix +++ b/hosts/by-name/desko/fs.nix @@ -2,17 +2,10 @@ { sane.persist.root-on-tmpfs = true; - # we need a /tmp for building large nix things. + # increase /tmp space (defaults to 50% of RAM) for building large nix things. # a cross-compiled kernel, particularly, will easily use 30+GB of tmp - fileSystems."/tmp" = { - device = "none"; - fsType = "tmpfs"; - options = [ - "mode=777" - "size=64G" - "defaults" - ]; - }; + fileSystems."/tmp".options = [ "size=64G" ]; + fileSystems."/nix" = { # device = "/dev/disk/by-uuid/985a0a32-da52-4043-9df7-615adec2e4ff"; device = "/dev/disk/by-uuid/0ab0770b-7734-4167-88d9-6e4e20bb2a56"; diff --git a/hosts/by-name/lappy/fs.nix b/hosts/by-name/lappy/fs.nix index c26b5bd28..d741816ea 100644 --- a/hosts/by-name/lappy/fs.nix +++ b/hosts/by-name/lappy/fs.nix @@ -2,15 +2,6 @@ { sane.persist.root-on-tmpfs = true; - # we need a /tmp of default size (half RAM) for building large nix things - fileSystems."/tmp" = { - device = "none"; - fsType = "tmpfs"; - options = [ - "mode=777" - "defaults" - ]; - }; fileSystems."/nix" = { device = "/dev/disk/by-uuid/75230e56-2c69-4e41-b03e-68475f119980"; diff --git a/hosts/by-name/servo/fs.nix b/hosts/by-name/servo/fs.nix index e58d05bb8..f41d927d1 100644 --- a/hosts/by-name/servo/fs.nix +++ b/hosts/by-name/servo/fs.nix @@ -2,15 +2,6 @@ { sane.persist.root-on-tmpfs = true; - # we need a /tmp for building large nix things - fileSystems."/tmp" = { - device = "none"; - fsType = "tmpfs"; - options = [ - "mode=777" - "defaults" - ]; - }; fileSystems."/nix" = { device = "/dev/disk/by-uuid/cc81cca0-3cc7-4d82-a00c-6243af3e7776"; diff --git a/hosts/modules/roles/default.nix b/hosts/modules/roles/default.nix index a668caeb6..9f16952e3 100644 --- a/hosts/modules/roles/default.nix +++ b/hosts/modules/roles/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, lib, ... }: { imports = [ ./ac.nix @@ -6,4 +6,13 @@ ./client ./dev-machine.nix ]; + + fileSystems."/tmp" = lib.mkIf (config.sane.roles.build-machine.enable || config.sane.roles.dev-machine) { + device = "none"; + fsType = "tmpfs"; + options = [ + "mode=777" + "defaults" + ]; + }; }