├── .envrc ├── .gitignore ├── .vscode └── settings.json ├── README.md ├── flake-modules ├── vscode-server-wsl-tunnels.nix ├── vscode-server-wsl.nix └── vscode-server.nix ├── flake.lock └── flake.nix /.envrc: -------------------------------------------------------------------------------- 1 | if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then 2 | source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" 3 | fi 4 | 5 | use flake . '--no-eval-cache' '--show-trace' 6 | 7 | # TODO: change this to `dotenv_if_exists .env` once https://github.com/direnv/direnv/issues/1028 is fixed 8 | source_env_if_exists .envrc.private 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.direnv/ 2 | /result 3 | /.devenv/ 4 | /.devcontainer.json 5 | /.venv 6 | 7 | # nixago: ignore-linked-files 8 | /.vscode/extensions.json 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "nix.enableLanguageServer": true, 3 | "nix.serverPath": "/nix/store/wpliafs8ndnm7ya78kw1jpmjqsv3942a-nil-2023-08-09/bin/nil", 4 | "nix.serverSettings": { 5 | "nil": { 6 | "formatting": { 7 | "command": [ 8 | "/nix/store/kszxch30fhcy64jviq47sf57a1m2ghbm-nixpkgs-fmt-1.3.0/bin/nixpkgs-fmt" 9 | ] 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nixos-wsl-vscode 2 | A nixos configuration that works with VS Code in WSL2 3 | 4 | ## Usage: 5 | 6 | ### As a NixOS module in your flake 7 | 8 | ```nix 9 | { 10 | inputs.nixos-wsl-vscode.url = "github:Atry/nixos-wsl-vscode"; 11 | 12 | outputs = { self, nixpkgs, nixos-wsl-vscode }: { 13 | nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem { 14 | modules = [ 15 | nixos-wsl-vscode.nixosModules.vscodeServerWsl 16 | ({ config, pkgs, ... }: { 17 | # rest of your configuration 18 | }) 19 | ]; 20 | }; 21 | }; 22 | } 23 | ``` 24 | ### As a NixOS module in your `configuration.nix` 25 | 26 | ```nix 27 | { config, pkgs, ... }: { 28 | imports = [ 29 | (builtins.getFlake "github:Atry/nixos-wsl-vscode").nixosModules.vscodeServerWsl 30 | ]; 31 | 32 | # rest of your configuration 33 | } 34 | ``` 35 | 36 | ### To use "Remote - Tunnels" extension 37 | 38 | If you want to use VS Code's [Remote - Tunnels](https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-server) extension to access WSL2 from another computer, extra workarounds are needed. To apply the workarounds, replace previous examples' `nixosModules.vscodeServerWsl` with `nixosModules.vscodeServerWslTunnels`. The NixOS module `vscodeServerWslTunnels` would create extra symlinks under your WSL2's `/bin` path. 39 | 40 | ### As a NixOS configuration 41 | 42 | Switch to the `main` branch of this configuration: 43 | 44 | ```sh 45 | sudo nixos-rebuild --flake github:Atry/nixos-wsl-vscode#nixosWslVsCode switch 46 | ``` 47 | 48 | Switch to a local work directory this configuration: 49 | 50 | ```sh 51 | sudo nixos-rebuild --flake .#nixosWslVsCode switch 52 | ``` 53 | 54 | Note that this NixOS configuration also includes [other optionated settings](https://github.com/Atry/nixos-wsl-vscode/blob/5d1b74b6b39cd9eb26d62e2ffa90ceaa38278352/flake.nix#L35-L82). 55 | -------------------------------------------------------------------------------- /flake-modules/vscode-server-wsl-tunnels.nix: -------------------------------------------------------------------------------- 1 | topLevel@{ inputs, lib, ... }: { 2 | flake.nixosModules.vscodeServerWslTunnels = nixosModule@{ pkgs, ... }: { 3 | imports = [ 4 | inputs.nixos-wsl.nixosModules.wsl 5 | topLevel.config.flake.nixosModules.vscodeServerWsl 6 | 7 | ]; 8 | config = { 9 | 10 | wsl.extraBin = [ 11 | # VS Code's "Remote - Tunnels" extension does not respect `~/.vscode-server/server-env-setup`, so we need to provide these binaries under `/bin`. 12 | { src = "${pkgs.coreutils}/bin/uname"; } 13 | { src = "${pkgs.coreutils}/bin/rm"; } 14 | { src = "${pkgs.coreutils}/bin/mkdir"; } 15 | { src = "${pkgs.coreutils}/bin/mv"; } 16 | 17 | { src = "${pkgs.coreutils}/bin/dirname"; } 18 | { src = "${pkgs.coreutils}/bin/readlink"; } 19 | { src = "${pkgs.coreutils}/bin/wc"; } 20 | { src = "${pkgs.coreutils}/bin/date"; } 21 | { src = "${pkgs.coreutils}/bin/sleep"; } 22 | { src = "${pkgs.coreutils}/bin/cat"; } 23 | { src = "${pkgs.gnused}/bin/sed"; } 24 | { src = "${pkgs.gnutar}/bin/tar"; } 25 | { src = "${pkgs.gzip}/bin/gzip"; } 26 | ]; 27 | }; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /flake-modules/vscode-server-wsl.nix: -------------------------------------------------------------------------------- 1 | topLevel@{ inputs, lib, ... }: { 2 | imports = [ 3 | ./vscode-server.nix 4 | ]; 5 | flake.nixosModules.vscodeServerWsl = nixosModule: { 6 | imports = [ 7 | inputs.nixos-wsl.nixosModules.wsl 8 | topLevel.config.flake.nixosModules.vscodeServer 9 | ]; 10 | config.vscodeServer.serverEnvSetup = '' 11 | # Workaround for https://github.com/nix-community/NixOS-WSL/issues/171 12 | . ${lib.escapeShellArg nixosModule.config.system.build.setEnvironment} 13 | ''; 14 | }; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /flake-modules/vscode-server.nix: -------------------------------------------------------------------------------- 1 | { inputs, lib, ... }: { 2 | flake.nixosModules.vscodeServer = nixosModule@{ pkgs, ... }: { 3 | imports = [ 4 | inputs.nix-ml-ops.nixosModules.nixLd 5 | inputs.home-manager.nixosModules.home-manager 6 | ]; 7 | options.vscodeServer = { 8 | users = lib.mkOption { 9 | type = lib.types.listOf lib.types.str; 10 | description = "the list of users who would use VSCode server, by default all the normal users in the NixOS configuration"; 11 | default = lib.trivial.pipe nixosModule.config.users.users [ 12 | (lib.attrsets.filterAttrs (_: userConfig: userConfig.isNormalUser)) 13 | lib.attrNames 14 | ]; 15 | }; 16 | serverEnvSetup = lib.mkOption { 17 | type = lib.types.lines; 18 | description = "the content of `~/.vscode-server/server-env-setup`"; 19 | }; 20 | }; 21 | config = { 22 | vscodeServer.serverEnvSetup = '' 23 | export PATH=$PATH:${lib.makeBinPath [ pkgs.wget ]} 24 | export EDITOR="code --wait" 25 | ''; 26 | home-manager = { 27 | sharedModules = [ 28 | { 29 | home.stateVersion = lib.mkDefault "23.11"; 30 | } 31 | ]; 32 | users = lib.pipe nixosModule.config.vscodeServer.users [ 33 | (builtins.map (name: { 34 | inherit name; 35 | value.home.file.".vscode-server/server-env-setup".text = nixosModule.config.vscodeServer.serverEnvSetup; 36 | })) 37 | builtins.listToAttrs 38 | ]; 39 | }; 40 | 41 | programs.nix-ld.libraries = [ 42 | pkgs.zlib 43 | ]; 44 | }; 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "conda-channels": { 4 | "flake": false, 5 | "locked": { 6 | "lastModified": 1682188392, 7 | "narHash": "sha256-5ZTgqNXCb94tqSrB7Zaswa+8AdiNZO+E7XYMtif1q+8=", 8 | "owner": "davhau", 9 | "repo": "conda-channels", 10 | "rev": "8c769055ca1670a202d2024cef5d39901f877416", 11 | "type": "github" 12 | }, 13 | "original": { 14 | "owner": "davhau", 15 | "repo": "conda-channels", 16 | "type": "github" 17 | } 18 | }, 19 | "devenv": { 20 | "inputs": { 21 | "flake-compat": "flake-compat", 22 | "nix": "nix", 23 | "nixpkgs": [ 24 | "nix-ml-ops", 25 | "nixpkgs" 26 | ], 27 | "pre-commit-hooks": "pre-commit-hooks" 28 | }, 29 | "locked": { 30 | "lastModified": 1712101228, 31 | "narHash": "sha256-4LQfsKTl4UA+mQ9O+4jJ9K7qvCBBhEIVH6lNshFq6Vo=", 32 | "owner": "Atry", 33 | "repo": "devenv", 34 | "rev": "42b5726802a32e7fd6c52d82b7f4fe88d6c1fd10", 35 | "type": "github" 36 | }, 37 | "original": { 38 | "owner": "Atry", 39 | "ref": "nix-ml-ops", 40 | "repo": "devenv", 41 | "type": "github" 42 | } 43 | }, 44 | "flake-compat": { 45 | "flake": false, 46 | "locked": { 47 | "lastModified": 1673956053, 48 | "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", 49 | "owner": "edolstra", 50 | "repo": "flake-compat", 51 | "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", 52 | "type": "github" 53 | }, 54 | "original": { 55 | "owner": "edolstra", 56 | "repo": "flake-compat", 57 | "type": "github" 58 | } 59 | }, 60 | "flake-compat_2": { 61 | "flake": false, 62 | "locked": { 63 | "lastModified": 1673956053, 64 | "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", 65 | "owner": "edolstra", 66 | "repo": "flake-compat", 67 | "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", 68 | "type": "github" 69 | }, 70 | "original": { 71 | "owner": "edolstra", 72 | "repo": "flake-compat", 73 | "type": "github" 74 | } 75 | }, 76 | "flake-compat_3": { 77 | "flake": false, 78 | "locked": { 79 | "lastModified": 1696426674, 80 | "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 81 | "owner": "edolstra", 82 | "repo": "flake-compat", 83 | "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 84 | "type": "github" 85 | }, 86 | "original": { 87 | "owner": "edolstra", 88 | "repo": "flake-compat", 89 | "type": "github" 90 | } 91 | }, 92 | "flake-parts": { 93 | "inputs": { 94 | "nixpkgs-lib": "nixpkgs-lib" 95 | }, 96 | "locked": { 97 | "lastModified": 1709336216, 98 | "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", 99 | "owner": "hercules-ci", 100 | "repo": "flake-parts", 101 | "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", 102 | "type": "github" 103 | }, 104 | "original": { 105 | "owner": "hercules-ci", 106 | "repo": "flake-parts", 107 | "type": "github" 108 | } 109 | }, 110 | "flake-utils": { 111 | "inputs": { 112 | "systems": "systems" 113 | }, 114 | "locked": { 115 | "lastModified": 1685518550, 116 | "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", 117 | "owner": "numtide", 118 | "repo": "flake-utils", 119 | "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", 120 | "type": "github" 121 | }, 122 | "original": { 123 | "owner": "numtide", 124 | "repo": "flake-utils", 125 | "type": "github" 126 | } 127 | }, 128 | "flake-utils_10": { 129 | "inputs": { 130 | "systems": "systems_7" 131 | }, 132 | "locked": { 133 | "lastModified": 1710146030, 134 | "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", 135 | "owner": "numtide", 136 | "repo": "flake-utils", 137 | "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", 138 | "type": "github" 139 | }, 140 | "original": { 141 | "owner": "numtide", 142 | "repo": "flake-utils", 143 | "type": "github" 144 | } 145 | }, 146 | "flake-utils_2": { 147 | "inputs": { 148 | "systems": "systems_2" 149 | }, 150 | "locked": { 151 | "lastModified": 1685518550, 152 | "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", 153 | "owner": "numtide", 154 | "repo": "flake-utils", 155 | "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", 156 | "type": "github" 157 | }, 158 | "original": { 159 | "owner": "numtide", 160 | "repo": "flake-utils", 161 | "type": "github" 162 | } 163 | }, 164 | "flake-utils_3": { 165 | "inputs": { 166 | "systems": "systems_3" 167 | }, 168 | "locked": { 169 | "lastModified": 1694529238, 170 | "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", 171 | "owner": "numtide", 172 | "repo": "flake-utils", 173 | "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", 174 | "type": "github" 175 | }, 176 | "original": { 177 | "owner": "numtide", 178 | "repo": "flake-utils", 179 | "type": "github" 180 | } 181 | }, 182 | "flake-utils_4": { 183 | "locked": { 184 | "lastModified": 1653893745, 185 | "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", 186 | "owner": "numtide", 187 | "repo": "flake-utils", 188 | "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", 189 | "type": "github" 190 | }, 191 | "original": { 192 | "owner": "numtide", 193 | "repo": "flake-utils", 194 | "type": "github" 195 | } 196 | }, 197 | "flake-utils_5": { 198 | "locked": { 199 | "lastModified": 1653893745, 200 | "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", 201 | "owner": "numtide", 202 | "repo": "flake-utils", 203 | "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", 204 | "type": "github" 205 | }, 206 | "original": { 207 | "owner": "numtide", 208 | "repo": "flake-utils", 209 | "type": "github" 210 | } 211 | }, 212 | "flake-utils_6": { 213 | "locked": { 214 | "lastModified": 1653893745, 215 | "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", 216 | "owner": "numtide", 217 | "repo": "flake-utils", 218 | "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", 219 | "type": "github" 220 | }, 221 | "original": { 222 | "owner": "numtide", 223 | "repo": "flake-utils", 224 | "type": "github" 225 | } 226 | }, 227 | "flake-utils_7": { 228 | "locked": { 229 | "lastModified": 1653893745, 230 | "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", 231 | "owner": "numtide", 232 | "repo": "flake-utils", 233 | "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", 234 | "type": "github" 235 | }, 236 | "original": { 237 | "owner": "numtide", 238 | "repo": "flake-utils", 239 | "type": "github" 240 | } 241 | }, 242 | "flake-utils_8": { 243 | "locked": { 244 | "lastModified": 1653893745, 245 | "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", 246 | "owner": "numtide", 247 | "repo": "flake-utils", 248 | "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", 249 | "type": "github" 250 | }, 251 | "original": { 252 | "owner": "numtide", 253 | "repo": "flake-utils", 254 | "type": "github" 255 | } 256 | }, 257 | "flake-utils_9": { 258 | "inputs": { 259 | "systems": "systems_4" 260 | }, 261 | "locked": { 262 | "lastModified": 1705309234, 263 | "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", 264 | "owner": "numtide", 265 | "repo": "flake-utils", 266 | "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", 267 | "type": "github" 268 | }, 269 | "original": { 270 | "owner": "numtide", 271 | "repo": "flake-utils", 272 | "type": "github" 273 | } 274 | }, 275 | "gitignore": { 276 | "inputs": { 277 | "nixpkgs": [ 278 | "nix-ml-ops", 279 | "devenv", 280 | "pre-commit-hooks", 281 | "nixpkgs" 282 | ] 283 | }, 284 | "locked": { 285 | "lastModified": 1660459072, 286 | "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", 287 | "owner": "hercules-ci", 288 | "repo": "gitignore.nix", 289 | "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", 290 | "type": "github" 291 | }, 292 | "original": { 293 | "owner": "hercules-ci", 294 | "repo": "gitignore.nix", 295 | "type": "github" 296 | } 297 | }, 298 | "home-manager": { 299 | "inputs": { 300 | "nixpkgs": [ 301 | "nixpkgs" 302 | ] 303 | }, 304 | "locked": { 305 | "lastModified": 1710423955, 306 | "narHash": "sha256-6N/65EqYVqCaz5SVoPMx2HgA+DJZAlw5lW+U9VHSSbE=", 307 | "owner": "nix-community", 308 | "repo": "home-manager", 309 | "rev": "587719494ed18a184c98c4d55dde9469af4446bf", 310 | "type": "github" 311 | }, 312 | "original": { 313 | "owner": "nix-community", 314 | "repo": "home-manager", 315 | "type": "github" 316 | } 317 | }, 318 | "lowdown-src": { 319 | "flake": false, 320 | "locked": { 321 | "lastModified": 1633514407, 322 | "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", 323 | "owner": "kristapsdz", 324 | "repo": "lowdown", 325 | "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", 326 | "type": "github" 327 | }, 328 | "original": { 329 | "owner": "kristapsdz", 330 | "repo": "lowdown", 331 | "type": "github" 332 | } 333 | }, 334 | "mach-nix": { 335 | "flake": false, 336 | "locked": { 337 | "lastModified": 1681265293, 338 | "narHash": "sha256-sUoErTMmR9xALl2me7AqpCoLT48LAnFWIDMnNctgARY=", 339 | "owner": "Preemo-Inc", 340 | "repo": "mach-nix", 341 | "rev": "4ce490eb409afb764cdb46803bed8faea8319c04", 342 | "type": "github" 343 | }, 344 | "original": { 345 | "owner": "Preemo-Inc", 346 | "repo": "mach-nix", 347 | "type": "github" 348 | } 349 | }, 350 | "mk-shell-bin": { 351 | "locked": { 352 | "lastModified": 1677004959, 353 | "narHash": "sha256-/uEkr1UkJrh11vD02aqufCxtbF5YnhRTIKlx5kyvf+I=", 354 | "owner": "rrbutani", 355 | "repo": "nix-mk-shell-bin", 356 | "rev": "ff5d8bd4d68a347be5042e2f16caee391cd75887", 357 | "type": "github" 358 | }, 359 | "original": { 360 | "owner": "rrbutani", 361 | "repo": "nix-mk-shell-bin", 362 | "type": "github" 363 | } 364 | }, 365 | "nix": { 366 | "inputs": { 367 | "lowdown-src": "lowdown-src", 368 | "nixpkgs": [ 369 | "nix-ml-ops", 370 | "devenv", 371 | "nixpkgs" 372 | ], 373 | "nixpkgs-regression": "nixpkgs-regression" 374 | }, 375 | "locked": { 376 | "lastModified": 1676545802, 377 | "narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=", 378 | "owner": "domenkozar", 379 | "repo": "nix", 380 | "rev": "7c91803598ffbcfe4a55c44ac6d49b2cf07a527f", 381 | "type": "github" 382 | }, 383 | "original": { 384 | "owner": "domenkozar", 385 | "ref": "relaxed-flakes", 386 | "repo": "nix", 387 | "type": "github" 388 | } 389 | }, 390 | "nix-github-actions": { 391 | "inputs": { 392 | "nixpkgs": [ 393 | "nix-ml-ops", 394 | "poetry2nix", 395 | "nixpkgs" 396 | ] 397 | }, 398 | "locked": { 399 | "lastModified": 1703863825, 400 | "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", 401 | "owner": "nix-community", 402 | "repo": "nix-github-actions", 403 | "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", 404 | "type": "github" 405 | }, 406 | "original": { 407 | "owner": "nix-community", 408 | "repo": "nix-github-actions", 409 | "type": "github" 410 | } 411 | }, 412 | "nix-index-database": { 413 | "inputs": { 414 | "nixpkgs": [ 415 | "nixpkgs" 416 | ] 417 | }, 418 | "locked": { 419 | "lastModified": 1712459390, 420 | "narHash": "sha256-e12bNDottaGoBgd0AdH/bQvk854xunlWAdZwr/oHO1c=", 421 | "owner": "nix-community", 422 | "repo": "nix-index-database", 423 | "rev": "4676d72d872459e1e3a248d049609f110c570e9a", 424 | "type": "github" 425 | }, 426 | "original": { 427 | "owner": "nix-community", 428 | "repo": "nix-index-database", 429 | "type": "github" 430 | } 431 | }, 432 | "nix-ld-rs": { 433 | "inputs": { 434 | "flake-compat": "flake-compat_2", 435 | "flake-utils": "flake-utils_2", 436 | "nixpkgs": "nixpkgs", 437 | "rust-overlay": "rust-overlay" 438 | }, 439 | "locked": { 440 | "lastModified": 1692825040, 441 | "narHash": "sha256-01V6wiLzXe2acXPriiHnn/MMQpwYXcneC0tIqbdcny8=", 442 | "owner": "nix-community", 443 | "repo": "nix-ld-rs", 444 | "rev": "35987e7f70ca6845489e8abc6e7897775c01a5c4", 445 | "type": "github" 446 | }, 447 | "original": { 448 | "owner": "nix-community", 449 | "repo": "nix-ld-rs", 450 | "type": "github" 451 | } 452 | }, 453 | "nix-ml-ops": { 454 | "inputs": { 455 | "conda-channels": "conda-channels", 456 | "devenv": "devenv", 457 | "flake-parts": [ 458 | "flake-parts" 459 | ], 460 | "mach-nix": "mach-nix", 461 | "mk-shell-bin": "mk-shell-bin", 462 | "nix-ld-rs": "nix-ld-rs", 463 | "nix2container": "nix2container", 464 | "nixago": "nixago", 465 | "nixos-generators": "nixos-generators", 466 | "nixpkgs": [ 467 | "nixpkgs" 468 | ], 469 | "nixpkgs_22_05": "nixpkgs_22_05", 470 | "poetry-add-requirements-txt": "poetry-add-requirements-txt", 471 | "poetry2nix": "poetry2nix", 472 | "pypi-deps-db": "pypi-deps-db", 473 | "systems": "systems_6" 474 | }, 475 | "locked": { 476 | "lastModified": 1712639516, 477 | "narHash": "sha256-w2t8d5h4f9IE76FkrFzsbNTb6/jPD88LIbViOmPmpl4=", 478 | "owner": "Atry", 479 | "repo": "nix-ml-ops", 480 | "rev": "783aec5b26eb635775593a79b25d25f7c0a8113e", 481 | "type": "github" 482 | }, 483 | "original": { 484 | "owner": "Atry", 485 | "repo": "nix-ml-ops", 486 | "type": "github" 487 | } 488 | }, 489 | "nix2container": { 490 | "inputs": { 491 | "flake-utils": "flake-utils_3", 492 | "nixpkgs": [ 493 | "nix-ml-ops", 494 | "nixpkgs" 495 | ] 496 | }, 497 | "locked": { 498 | "lastModified": 1711883218, 499 | "narHash": "sha256-XKHhQJ0tk/S/LbYJb31VVvZKWdb+uCFnvEuUQZJkP9o=", 500 | "owner": "nlewo", 501 | "repo": "nix2container", 502 | "rev": "2154ad0459abfa258edaab038b4716f474656e99", 503 | "type": "github" 504 | }, 505 | "original": { 506 | "owner": "nlewo", 507 | "repo": "nix2container", 508 | "type": "github" 509 | } 510 | }, 511 | "nixago": { 512 | "inputs": { 513 | "flake-utils": "flake-utils_4", 514 | "nixago-exts": "nixago-exts", 515 | "nixpkgs": [ 516 | "nix-ml-ops", 517 | "nixpkgs" 518 | ] 519 | }, 520 | "locked": { 521 | "lastModified": 1688836621, 522 | "narHash": "sha256-yKVQMxL9p7zCWUhnGhDzRVT8sDgHoI3V595lBK0C2YA=", 523 | "owner": "Preemo-Inc", 524 | "repo": "nixago", 525 | "rev": "4505d20aa89c659f3c6979a8bcd592405e386117", 526 | "type": "github" 527 | }, 528 | "original": { 529 | "owner": "Preemo-Inc", 530 | "ref": "no-gitignore", 531 | "repo": "nixago", 532 | "type": "github" 533 | } 534 | }, 535 | "nixago-exts": { 536 | "inputs": { 537 | "flake-utils": "flake-utils_5", 538 | "nixago": "nixago_2", 539 | "nixpkgs": [ 540 | "nix-ml-ops", 541 | "nixago", 542 | "nixpkgs" 543 | ] 544 | }, 545 | "locked": { 546 | "lastModified": 1676070308, 547 | "narHash": "sha256-QaJ65oc2l8iwQIGWUJ0EKjCeSuuCM/LqR8RauxZUUkc=", 548 | "owner": "nix-community", 549 | "repo": "nixago-extensions", 550 | "rev": "e5380cb0456f4ea3c86cf94e3039eb856bf07d0b", 551 | "type": "github" 552 | }, 553 | "original": { 554 | "owner": "nix-community", 555 | "repo": "nixago-extensions", 556 | "type": "github" 557 | } 558 | }, 559 | "nixago-exts_2": { 560 | "inputs": { 561 | "flake-utils": "flake-utils_7", 562 | "nixago": "nixago_3", 563 | "nixpkgs": [ 564 | "nix-ml-ops", 565 | "nixago", 566 | "nixago-exts", 567 | "nixago", 568 | "nixpkgs" 569 | ] 570 | }, 571 | "locked": { 572 | "lastModified": 1655508669, 573 | "narHash": "sha256-BDDdo5dZQMmwNH/GNacy33nPBnCpSIydWFPZs0kkj/g=", 574 | "owner": "nix-community", 575 | "repo": "nixago-extensions", 576 | "rev": "3022a932ce109258482ecc6568c163e8d0b426aa", 577 | "type": "github" 578 | }, 579 | "original": { 580 | "owner": "nix-community", 581 | "repo": "nixago-extensions", 582 | "type": "github" 583 | } 584 | }, 585 | "nixago_2": { 586 | "inputs": { 587 | "flake-utils": "flake-utils_6", 588 | "nixago-exts": "nixago-exts_2", 589 | "nixpkgs": [ 590 | "nix-ml-ops", 591 | "nixago", 592 | "nixago-exts", 593 | "nixpkgs" 594 | ] 595 | }, 596 | "locked": { 597 | "lastModified": 1676070010, 598 | "narHash": "sha256-iYzJIWptE1EUD8VINAg66AAMUajizg8JUYN3oBmb8no=", 599 | "owner": "nix-community", 600 | "repo": "nixago", 601 | "rev": "d480ba6c0c16e2c5c0bd2122852d6a0c9ad1ed0e", 602 | "type": "github" 603 | }, 604 | "original": { 605 | "owner": "nix-community", 606 | "ref": "rename-config-data", 607 | "repo": "nixago", 608 | "type": "github" 609 | } 610 | }, 611 | "nixago_3": { 612 | "inputs": { 613 | "flake-utils": "flake-utils_8", 614 | "nixpkgs": [ 615 | "nix-ml-ops", 616 | "nixago", 617 | "nixago-exts", 618 | "nixago", 619 | "nixago-exts", 620 | "nixpkgs" 621 | ] 622 | }, 623 | "locked": { 624 | "lastModified": 1655405483, 625 | "narHash": "sha256-Crd49aZWNrpczlRTOwWGfwBMsTUoG9vlHDKQC7cx264=", 626 | "owner": "nix-community", 627 | "repo": "nixago", 628 | "rev": "e6a9566c18063db5b120e69e048d3627414e327d", 629 | "type": "github" 630 | }, 631 | "original": { 632 | "owner": "nix-community", 633 | "repo": "nixago", 634 | "type": "github" 635 | } 636 | }, 637 | "nixlib": { 638 | "locked": { 639 | "lastModified": 1693701915, 640 | "narHash": "sha256-waHPLdDYUOHSEtMKKabcKIMhlUOHPOOPQ9UyFeEoovs=", 641 | "owner": "nix-community", 642 | "repo": "nixpkgs.lib", 643 | "rev": "f5af57d3ef9947a70ac86e42695231ac1ad00c25", 644 | "type": "github" 645 | }, 646 | "original": { 647 | "owner": "nix-community", 648 | "repo": "nixpkgs.lib", 649 | "type": "github" 650 | } 651 | }, 652 | "nixos-generators": { 653 | "inputs": { 654 | "nixlib": "nixlib", 655 | "nixpkgs": [ 656 | "nix-ml-ops", 657 | "nixpkgs" 658 | ] 659 | }, 660 | "locked": { 661 | "lastModified": 1696058303, 662 | "narHash": "sha256-eNqKWpF5zG0SrgbbtljFOrRgFgRzCc4++TMFADBMLnc=", 663 | "owner": "nix-community", 664 | "repo": "nixos-generators", 665 | "rev": "150f38bd1e09e20987feacb1b0d5991357532fb5", 666 | "type": "github" 667 | }, 668 | "original": { 669 | "owner": "nix-community", 670 | "repo": "nixos-generators", 671 | "type": "github" 672 | } 673 | }, 674 | "nixos-wsl": { 675 | "inputs": { 676 | "flake-compat": "flake-compat_3", 677 | "flake-utils": "flake-utils_10", 678 | "nixpkgs": [ 679 | "nixpkgs" 680 | ] 681 | }, 682 | "locked": { 683 | "lastModified": 1722253092, 684 | "narHash": "sha256-37vyqHPx57deHhwvi4jwyNQLYkhm/rlVTYKOG1iahsc=", 685 | "owner": "nix-community", 686 | "repo": "NixOS-WSL", 687 | "rev": "f373ad59ae5866f0f98216bd5c71526b373450d2", 688 | "type": "github" 689 | }, 690 | "original": { 691 | "owner": "nix-community", 692 | "repo": "NixOS-WSL", 693 | "type": "github" 694 | } 695 | }, 696 | "nixpkgs": { 697 | "locked": { 698 | "lastModified": 1692638711, 699 | "narHash": "sha256-J0LgSFgJVGCC1+j5R2QndadWI1oumusg6hCtYAzLID4=", 700 | "owner": "NixOS", 701 | "repo": "nixpkgs", 702 | "rev": "91a22f76cd1716f9d0149e8a5c68424bb691de15", 703 | "type": "github" 704 | }, 705 | "original": { 706 | "owner": "NixOS", 707 | "ref": "nixos-unstable", 708 | "repo": "nixpkgs", 709 | "type": "github" 710 | } 711 | }, 712 | "nixpkgs-lib": { 713 | "locked": { 714 | "dir": "lib", 715 | "lastModified": 1709237383, 716 | "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", 717 | "owner": "NixOS", 718 | "repo": "nixpkgs", 719 | "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", 720 | "type": "github" 721 | }, 722 | "original": { 723 | "dir": "lib", 724 | "owner": "NixOS", 725 | "ref": "nixos-unstable", 726 | "repo": "nixpkgs", 727 | "type": "github" 728 | } 729 | }, 730 | "nixpkgs-regression": { 731 | "locked": { 732 | "lastModified": 1643052045, 733 | "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", 734 | "owner": "NixOS", 735 | "repo": "nixpkgs", 736 | "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", 737 | "type": "github" 738 | }, 739 | "original": { 740 | "owner": "NixOS", 741 | "repo": "nixpkgs", 742 | "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", 743 | "type": "github" 744 | } 745 | }, 746 | "nixpkgs-stable": { 747 | "locked": { 748 | "lastModified": 1685801374, 749 | "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", 750 | "owner": "NixOS", 751 | "repo": "nixpkgs", 752 | "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", 753 | "type": "github" 754 | }, 755 | "original": { 756 | "owner": "NixOS", 757 | "ref": "nixos-23.05", 758 | "repo": "nixpkgs", 759 | "type": "github" 760 | } 761 | }, 762 | "nixpkgs_2": { 763 | "locked": { 764 | "lastModified": 1720031269, 765 | "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", 766 | "owner": "NixOS", 767 | "repo": "nixpkgs", 768 | "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", 769 | "type": "github" 770 | }, 771 | "original": { 772 | "owner": "NixOS", 773 | "ref": "nixos-unstable", 774 | "repo": "nixpkgs", 775 | "type": "github" 776 | } 777 | }, 778 | "nixpkgs_22_05": { 779 | "locked": { 780 | "lastModified": 1672580127, 781 | "narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=", 782 | "owner": "NixOS", 783 | "repo": "nixpkgs", 784 | "rev": "0874168639713f547c05947c76124f78441ea46c", 785 | "type": "github" 786 | }, 787 | "original": { 788 | "id": "nixpkgs", 789 | "ref": "nixos-22.05", 790 | "type": "indirect" 791 | } 792 | }, 793 | "poetry-add-requirements-txt": { 794 | "flake": false, 795 | "locked": { 796 | "lastModified": 1654077719, 797 | "narHash": "sha256-BpryyfhKTNPDYIZXHTfHexVPZMhl76L81tsfOGvQKto=", 798 | "owner": "tddschn", 799 | "repo": "poetry-add-requirements.txt", 800 | "rev": "710dde128b3746e7269e423f46f1e0e432c47043", 801 | "type": "github" 802 | }, 803 | "original": { 804 | "owner": "tddschn", 805 | "repo": "poetry-add-requirements.txt", 806 | "type": "github" 807 | } 808 | }, 809 | "poetry2nix": { 810 | "inputs": { 811 | "flake-utils": "flake-utils_9", 812 | "nix-github-actions": "nix-github-actions", 813 | "nixpkgs": [ 814 | "nix-ml-ops", 815 | "nixpkgs" 816 | ], 817 | "systems": "systems_5", 818 | "treefmt-nix": "treefmt-nix" 819 | }, 820 | "locked": { 821 | "lastModified": 1712424287, 822 | "narHash": "sha256-6rh8ytPhLjFcbkCCypE2ras3W/lFnkWwXW++xpqEqAU=", 823 | "owner": "Atry", 824 | "repo": "poetry2nix", 825 | "rev": "fa856d3bd3d47982690166c8ebf04bd728ffdacb", 826 | "type": "github" 827 | }, 828 | "original": { 829 | "owner": "Atry", 830 | "ref": "jupyter-existing-provisioner-vllm", 831 | "repo": "poetry2nix", 832 | "type": "github" 833 | } 834 | }, 835 | "pre-commit-hooks": { 836 | "inputs": { 837 | "flake-compat": [ 838 | "nix-ml-ops", 839 | "devenv", 840 | "flake-compat" 841 | ], 842 | "flake-utils": "flake-utils", 843 | "gitignore": "gitignore", 844 | "nixpkgs": [ 845 | "nix-ml-ops", 846 | "devenv", 847 | "nixpkgs" 848 | ], 849 | "nixpkgs-stable": "nixpkgs-stable" 850 | }, 851 | "locked": { 852 | "lastModified": 1688056373, 853 | "narHash": "sha256-2+SDlNRTKsgo3LBRiMUcoEUb6sDViRNQhzJquZ4koOI=", 854 | "owner": "cachix", 855 | "repo": "pre-commit-hooks.nix", 856 | "rev": "5843cf069272d92b60c3ed9e55b7a8989c01d4c7", 857 | "type": "github" 858 | }, 859 | "original": { 860 | "owner": "cachix", 861 | "repo": "pre-commit-hooks.nix", 862 | "type": "github" 863 | } 864 | }, 865 | "pypi-deps-db": { 866 | "flake": false, 867 | "locked": { 868 | "lastModified": 1682198241, 869 | "narHash": "sha256-tnhFetOjyVhI944sCPbv7xiTrMZ3F+qgrq2NCkyYVdk=", 870 | "owner": "DavHau", 871 | "repo": "pypi-deps-db", 872 | "rev": "0f67e6ea7384cea09f7dedbc7a69710b22da7cf2", 873 | "type": "github" 874 | }, 875 | "original": { 876 | "owner": "DavHau", 877 | "repo": "pypi-deps-db", 878 | "type": "github" 879 | } 880 | }, 881 | "root": { 882 | "inputs": { 883 | "flake-parts": "flake-parts", 884 | "home-manager": "home-manager", 885 | "nix-index-database": "nix-index-database", 886 | "nix-ml-ops": "nix-ml-ops", 887 | "nixos-wsl": "nixos-wsl", 888 | "nixpkgs": "nixpkgs_2" 889 | } 890 | }, 891 | "rust-overlay": { 892 | "inputs": { 893 | "flake-utils": [ 894 | "nix-ml-ops", 895 | "nix-ld-rs", 896 | "flake-utils" 897 | ], 898 | "nixpkgs": [ 899 | "nix-ml-ops", 900 | "nix-ld-rs", 901 | "nixpkgs" 902 | ] 903 | }, 904 | "locked": { 905 | "lastModified": 1692756590, 906 | "narHash": "sha256-VnktafFl+0U9wdYO8vGSFOYSSQ+GFd+MiMA0cTZ8mHg=", 907 | "owner": "oxalica", 908 | "repo": "rust-overlay", 909 | "rev": "a9e9946645fcf892c850f8e654a5e675a6fd14d8", 910 | "type": "github" 911 | }, 912 | "original": { 913 | "owner": "oxalica", 914 | "repo": "rust-overlay", 915 | "type": "github" 916 | } 917 | }, 918 | "systems": { 919 | "locked": { 920 | "lastModified": 1681028828, 921 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 922 | "owner": "nix-systems", 923 | "repo": "default", 924 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 925 | "type": "github" 926 | }, 927 | "original": { 928 | "owner": "nix-systems", 929 | "repo": "default", 930 | "type": "github" 931 | } 932 | }, 933 | "systems_2": { 934 | "locked": { 935 | "lastModified": 1681028828, 936 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 937 | "owner": "nix-systems", 938 | "repo": "default", 939 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 940 | "type": "github" 941 | }, 942 | "original": { 943 | "owner": "nix-systems", 944 | "repo": "default", 945 | "type": "github" 946 | } 947 | }, 948 | "systems_3": { 949 | "locked": { 950 | "lastModified": 1681028828, 951 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 952 | "owner": "nix-systems", 953 | "repo": "default", 954 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 955 | "type": "github" 956 | }, 957 | "original": { 958 | "owner": "nix-systems", 959 | "repo": "default", 960 | "type": "github" 961 | } 962 | }, 963 | "systems_4": { 964 | "locked": { 965 | "lastModified": 1681028828, 966 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 967 | "owner": "nix-systems", 968 | "repo": "default", 969 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 970 | "type": "github" 971 | }, 972 | "original": { 973 | "owner": "nix-systems", 974 | "repo": "default", 975 | "type": "github" 976 | } 977 | }, 978 | "systems_5": { 979 | "locked": { 980 | "lastModified": 1681028828, 981 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 982 | "owner": "nix-systems", 983 | "repo": "default", 984 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 985 | "type": "github" 986 | }, 987 | "original": { 988 | "id": "systems", 989 | "type": "indirect" 990 | } 991 | }, 992 | "systems_6": { 993 | "locked": { 994 | "lastModified": 1681028828, 995 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 996 | "owner": "nix-systems", 997 | "repo": "default", 998 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 999 | "type": "github" 1000 | }, 1001 | "original": { 1002 | "owner": "nix-systems", 1003 | "repo": "default", 1004 | "type": "github" 1005 | } 1006 | }, 1007 | "systems_7": { 1008 | "locked": { 1009 | "lastModified": 1681028828, 1010 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 1011 | "owner": "nix-systems", 1012 | "repo": "default", 1013 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 1014 | "type": "github" 1015 | }, 1016 | "original": { 1017 | "owner": "nix-systems", 1018 | "repo": "default", 1019 | "type": "github" 1020 | } 1021 | }, 1022 | "treefmt-nix": { 1023 | "inputs": { 1024 | "nixpkgs": [ 1025 | "nix-ml-ops", 1026 | "poetry2nix", 1027 | "nixpkgs" 1028 | ] 1029 | }, 1030 | "locked": { 1031 | "lastModified": 1708335038, 1032 | "narHash": "sha256-ETLZNFBVCabo7lJrpjD6cAbnE11eDOjaQnznmg/6hAE=", 1033 | "owner": "numtide", 1034 | "repo": "treefmt-nix", 1035 | "rev": "e504621290a1fd896631ddbc5e9c16f4366c9f65", 1036 | "type": "github" 1037 | }, 1038 | "original": { 1039 | "owner": "numtide", 1040 | "repo": "treefmt-nix", 1041 | "type": "github" 1042 | } 1043 | } 1044 | }, 1045 | "root": "root", 1046 | "version": 7 1047 | } 1048 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs = { 3 | flake-parts.url = "github:hercules-ci/flake-parts"; 4 | nix-ml-ops = { 5 | inputs.flake-parts.follows = "flake-parts"; 6 | inputs.nixpkgs.follows = "nixpkgs"; 7 | url = "github:Atry/nix-ml-ops"; 8 | }; 9 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 10 | nixos-wsl = { 11 | inputs.nixpkgs.follows = "nixpkgs"; 12 | url = "github:nix-community/NixOS-WSL"; 13 | }; 14 | home-manager = { 15 | inputs.nixpkgs.follows = "nixpkgs"; 16 | url = "github:nix-community/home-manager"; 17 | }; 18 | nix-index-database = { 19 | url = "github:nix-community/nix-index-database"; 20 | inputs.nixpkgs.follows = "nixpkgs"; 21 | }; 22 | }; 23 | outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: { 24 | imports = 25 | lib.trivial.pipe ./flake-modules [ 26 | builtins.readDir 27 | (lib.attrsets.filterAttrs (name: type: type == "regular" && lib.strings.hasSuffix ".nix" name)) 28 | builtins.attrNames 29 | (builtins.map (name: ./flake-modules/${name})) 30 | ] ++ 31 | [ 32 | inputs.nix-ml-ops.flakeModules.nixIde 33 | ]; 34 | 35 | flake = flake: { 36 | nixosConfigurations.nixosWslVsCode = inputs.nixpkgs.lib.nixosSystem { 37 | system = "x86_64-linux"; 38 | modules = [ 39 | inputs.nixos-wsl.nixosModules.wsl 40 | inputs.nix-index-database.nixosModules.nix-index 41 | flake.config.nixosModules.vscodeServerWslTunnels 42 | ({ lib, pkgs, config, ... }: { 43 | wsl = { 44 | enable = true; 45 | wslConf.automount.root = "/mnt"; 46 | defaultUser = "nixos"; 47 | startMenuLaunchers = true; 48 | useWindowsDriver = true; 49 | }; 50 | virtualisation = { 51 | docker = { 52 | enable = true; 53 | enableOnBoot = true; 54 | autoPrune.enable = true; 55 | }; 56 | podman = { 57 | enable = true; 58 | }; 59 | }; 60 | users.extraGroups.docker.members = config.users.groups.wheel.members; 61 | 62 | hardware.nvidia-container-toolkit.enable = true; 63 | 64 | nix.package = pkgs.nixVersions.latest; 65 | 66 | # Enable nix flakes 67 | nix.extraOptions = '' 68 | experimental-features = nix-command flakes impure-derivations ca-derivations 69 | ''; 70 | nix.settings.trusted-users = [ "@wheel" ]; 71 | 72 | nix.settings.extra-substituters = [ 73 | "https://nix-community.cachix.org" 74 | "https://cuda-maintainers.cachix.org" 75 | ]; 76 | nix.settings.extra-trusted-public-keys = [ 77 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 78 | "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" 79 | ]; 80 | nix.settings.auto-optimise-store = true; 81 | nix.settings.extra-sandbox-paths = lib.mkIf config.wsl.useWindowsDriver [ 82 | "/usr/lib/wsl" 83 | ]; 84 | 85 | system.stateVersion = "22.05"; 86 | 87 | environment.defaultPackages = [ 88 | pkgs.cachix 89 | pkgs.wsl-open 90 | ]; 91 | 92 | nixpkgs.config.allowUnfree = true; 93 | 94 | programs.git.enable = true; 95 | 96 | programs.direnv.enable = true; 97 | 98 | programs.command-not-found.enable = false; 99 | programs.nix-index.enable = true; 100 | programs.nix-index-database.comma.enable = true; 101 | }) 102 | ]; 103 | }; 104 | }; 105 | }); 106 | 107 | } 108 | --------------------------------------------------------------------------------