enable cuda in wsl

This commit is contained in:
2024-07-30 16:36:35 +05:30
parent f6085c0417
commit 0e1249235b

View File

@ -2,16 +2,24 @@
pkgs, pkgs,
inputs, inputs,
username, username,
config,
... ...
}: { }: {
imports = [ imports = [
inputs.nixos-wsl.nixosModules.wsl inputs.nixos-wsl.nixosModules.wsl
]; ];
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs = {
config.cudaSupport = true;
hostPlatform = "x86_64-linux";
};
wsl.enable = true; wsl = {
wsl.defaultUser = "${username}"; enable = true;
defaultUser = "${username}";
nativeSystemd = true;
useWindowsDriver = true;
};
nix = { nix = {
settings = { settings = {
@ -25,12 +33,18 @@
programs = { programs = {
ssh.startAgent = true; ssh.startAgent = true;
zsh.enable = true; zsh.enable = true;
nix-ld.enable = true; nix-ld = {
enable = true;
libraries = config.hardware.opengl.extraPackages;
};
dconf.enable = true; dconf.enable = true;
}; };
services = { services = {
ollama.enable = true; ollama = {
enable = true;
acceleration = "cuda";
};
openssh = { openssh = {
enable = true; enable = true;
settings = { settings = {