Skip to content

Commit 1043dfe

Browse files
committed
9p: increase memory size
1 parent 78a9367 commit 1043dfe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

share/nixos-shell/nixos-shell.nix

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ in {
9696
# Allow the user to login as root without password.
9797
users.extraUsers.root.initialHashedPassword = "";
9898

99+
# see https://wiki.qemu.org/Documentation/9psetup#Performance_Considerations
100+
# == 100M
101+
# FIXME? currently 500K seems to be the limit?
102+
virtualisation.msize = mkVMDefault 104857600;
103+
99104
services = let
100105
service = if lib.versionAtLeast (lib.versions.majorMinor lib.version) "20.09" then "getty" else "mingetty";
101106
in {
@@ -132,15 +137,15 @@ in {
132137
boot.initrd.postMountCommands =
133138
(lib.optionalString cfg.mounts.mountHome ''
134139
mkdir -p $targetRoot/home/
135-
mount -t 9p home $targetRoot/home/ -o trans=virtio,version=9p2000.L,cache=${cfg.mounts.cache}
140+
mount -t 9p home $targetRoot/home/ -o trans=virtio,version=9p2000.L,cache=${cfg.mounts.cache},msize=${toString config.virtualisation.msize}
136141
'') +
137142
(lib.optionalString (user != "" && cfg.mounts.mountNixProfile) ''
138143
mkdir -p $targetRoot/nix/var/nix/profiles/per-user/${user}/profile/
139-
mount -t 9p nixprofile $targetRoot/nix/var/nix/profiles/per-user/${user}/profile/ -o trans=virtio,version=9p2000.L,cache=${cfg.mounts.cache}
144+
mount -t 9p nixprofile $targetRoot/nix/var/nix/profiles/per-user/${user}/profile/ -o trans=virtio,version=9p2000.L,cache=${cfg.mounts.cache},msize=${toString config.virtualisation.msize}
140145
'') +
141146
builtins.concatStringsSep " " (lib.mapAttrsToList (target: mount: ''
142147
mkdir -p $targetRoot/${target}
143-
mount -t 9p ${mount.tag} $targetRoot/${target} -o trans=virtio,version=9p2000.L,cache=${mount.cache}
148+
mount -t 9p ${mount.tag} $targetRoot/${target} -o trans=virtio,version=9p2000.L,cache=${mount.cache},msize=${toString config.virtualisation.msize}
144149
'') cfg.mounts.extraMounts);
145150

146151
environment = {

0 commit comments

Comments
 (0)