allow wsl users to be changed with options

This commit is contained in:
UGA Innovation Factory
2025-12-11 17:47:37 -05:00
parent 11a9fcd038
commit 378a8aa7b7

View File

@@ -2,27 +2,35 @@
[ [
inputs.nixos-wsl.nixosModules.default inputs.nixos-wsl.nixosModules.default
inputs.vscode-server.nixosModules.default inputs.vscode-server.nixosModules.default
({ lib, ... }: { ({ lib, config, ... }: {
wsl.enable = true; options.host.wsl.user = lib.mkOption {
wsl.defaultUser = "engr-ugaif"; type = lib.types.str;
default = "engr-ugaif";
description = "The default user to log in as in WSL.";
};
# Enable the headless software profile config = {
modules.sw.enable = true; wsl.enable = true;
modules.sw.type = "headless"; wsl.defaultUser = config.host.wsl.user;
# Fix for VS Code Server in WSL if needed, though vscode-server input exists # Enable the headless software profile
services.vscode-server.enable = true; modules.sw.enable = true;
modules.sw.type = "headless";
# Disable Disko and Bootloader for WSL # Fix for VS Code Server in WSL if needed, though vscode-server input exists
disko.enableConfig = lib.mkForce false; services.vscode-server.enable = true;
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.grub.enable = lib.mkForce false;
# Disable networking for wsl (it manages its own networking) # Disable Disko and Bootloader for WSL
systemd.network.enable = lib.mkForce false; disko.enableConfig = lib.mkForce false;
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.grub.enable = lib.mkForce false;
# Provide dummy values for required options from boot.nix # Disable networking for wsl (it manages its own networking)
host.filesystem.device = "/dev/null"; systemd.network.enable = lib.mkForce false;
host.filesystem.swapSize = "0G";
# Provide dummy values for required options from boot.nix
host.filesystem.device = "/dev/null";
host.filesystem.swapSize = "0G";
};
}) })
] ]