diff options
| author | nzbr <mail@nzbr.de> | 2021-07-22 23:08:25 +0200 |
|---|---|---|
| committer | nzbr <mail@nzbr.de> | 2021-12-14 01:40:41 +0100 |
| commit | 7ba3b4d3dcc6b0dc86bbaab34c07c4d26ac48072 (patch) | |
| tree | da2a1724b14746cb43e1d46bebefe9fb8514076f /configuration.nix | |
| parent | 8326ff154e92017564bfe3ec599f69fbbc182fab (diff) | |
Add support for WSLg
Diffstat (limited to 'configuration.nix')
| -rw-r--r-- | configuration.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/configuration.nix b/configuration.nix index 6d19de0..e72eff7 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,6 +3,7 @@ with lib; let defaultUser = "nixos"; + automountPath = "/mnt"; syschdemd = import ./syschdemd.nix { inherit lib pkgs config defaultUser; }; in { @@ -43,4 +44,31 @@ in # Don't allow emergency mode, because we don't have a console. systemd.enableEmergencyMode = false; + + + # WSLg support + environment.variables = { + DISPLAY = ":0"; + WAYLAND_DISPLAY = "wayland-0"; + + PULSE_SERVER = "${automountPath}/wslg/PulseServer"; + XDG_RUNTIME_DIR = "${automountPath}/wslg/runtime-dir"; + WSL_INTEROP = "/run/WSL/1_interop"; + }; + + environment.etc."wsl.conf".text = '' + [automount] + enabled=true + mountFsTab=true + root=${automountPath}/ + options=metadata,uid=1000,gid=100 + ''; + + system.activationScripts.copy-launchers.text = '' + for x in applications icons; do + echo "Copying /usr/share/$x" + rm -rf /usr/share/$x + cp -r $systemConfig/sw/share/$x/. /usr/share/$x + done + ''; } |
