Skip to content

Commit

Permalink
Merge pull request #339 from Atry/patch-2
Browse files Browse the repository at this point in the history
wsl-distro: introduce `wsl.useWindowsDriver` option
  • Loading branch information
K900 authored Dec 30, 2023
2 parents d72abaf + eac32ce commit 70d7e2e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion modules/wsl-distro.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ in

options.wsl = with types; {
enable = mkEnableOption "support for running NixOS as a WSL distribution";
useWindowsDriver = mkEnableOption "OpenGL driver from the Windows host";
binShPkg = mkOption {
type = package;
internal = true;
Expand Down Expand Up @@ -70,7 +71,16 @@ in
# WSL does not support virtual consoles
console.enable = false;

hardware.opengl.enable = true; # Enable GPU acceleration
hardware.opengl = {
enable = true; # Enable GPU acceleration

extraPackages = mkIf cfg.useWindowsDriver [
(pkgs.runCommand "wsl-lib" { } ''
mkdir "$out"
ln -s /usr/lib/wsl/lib "$out/lib"
'')
];
};

environment = {
# Only set the options if the files are managed by WSL
Expand Down

0 comments on commit 70d7e2e

Please sign in to comment.