diff --git a/hosts/wsl2/default.nix b/hosts/wsl2/default.nix index b147716..ddc98ba 100644 --- a/hosts/wsl2/default.nix +++ b/hosts/wsl2/default.nix @@ -8,7 +8,26 @@ experimental-features = nix-command flakes ''; - + systemd.services.nixs-wsl-systemd-fix = { + description = "Fix the /dev/shm symlink to be a mount"; + unitConfig = { + DefaultDependencies = "no"; + Before = "sysinit.target"; + ConditionPathExists = "/dev/shm"; + ConditionPathIsSymbolicLink = "/dev/shm"; + ConditionPathIsMountPoint = "/run/shm"; + }; + serviceConfig = { + Type = "oneshot"; + ExecStart = [ + "${pkgs.coreutils-full}/bin/rm /dev/shm" + "/run/wrappers/bin/mount --bind -o X-mount.mkdir /run/shm /dev/shm" + ]; + }; + wantedBy = [ "sysinit.target" ]; + }; + + wsl = { enable = true; wslConf.automount.root = "/mnt";