feat: Allow wsl users to be changed with options
This commit is contained in:
committed by
Hunter Halloran
parent
4275b4cb37
commit
6b507366ec
@@ -2,27 +2,35 @@
|
||||
[
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
inputs.vscode-server.nixosModules.default
|
||||
({ lib, ... }: {
|
||||
wsl.enable = true;
|
||||
wsl.defaultUser = "engr-ugaif";
|
||||
|
||||
# Enable the headless software profile
|
||||
modules.sw.enable = true;
|
||||
modules.sw.type = "headless";
|
||||
({ lib, config, ... }: {
|
||||
options.host.wsl.user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "engr-ugaif";
|
||||
description = "The default user to log in as in WSL.";
|
||||
};
|
||||
|
||||
# Fix for VS Code Server in WSL if needed, though vscode-server input exists
|
||||
services.vscode-server.enable = true;
|
||||
config = {
|
||||
wsl.enable = true;
|
||||
wsl.defaultUser = config.host.wsl.user;
|
||||
|
||||
# Enable the headless software profile
|
||||
modules.sw.enable = true;
|
||||
modules.sw.type = "headless";
|
||||
|
||||
# Disable Disko and Bootloader for WSL
|
||||
disko.enableConfig = lib.mkForce false;
|
||||
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||
boot.loader.grub.enable = lib.mkForce false;
|
||||
# Fix for VS Code Server in WSL if needed, though vscode-server input exists
|
||||
services.vscode-server.enable = true;
|
||||
|
||||
# Disable networking for wsl (it manages its own networking)
|
||||
systemd.network.enable = lib.mkForce false;
|
||||
|
||||
# Provide dummy values for required options from boot.nix
|
||||
host.filesystem.device = "/dev/null";
|
||||
host.filesystem.swapSize = "0G";
|
||||
# Disable Disko and Bootloader for WSL
|
||||
disko.enableConfig = lib.mkForce false;
|
||||
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||
boot.loader.grub.enable = lib.mkForce false;
|
||||
|
||||
# Disable networking for wsl (it manages its own networking)
|
||||
systemd.network.enable = lib.mkForce false;
|
||||
|
||||
# Provide dummy values for required options from boot.nix
|
||||
host.filesystem.device = "/dev/null";
|
||||
host.filesystem.swapSize = "0G";
|
||||
};
|
||||
})
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user