Some checks failed
CI / Flake Check (push) Has been cancelled
CI / Evaluate Key Configurations (nix-builder) (push) Has been cancelled
CI / Evaluate Key Configurations (nix-desktop1) (push) Has been cancelled
CI / Evaluate Key Configurations (nix-laptop1) (push) Has been cancelled
CI / Evaluate Artifacts (installer-iso-nix-laptop1) (push) Has been cancelled
CI / Evaluate Artifacts (lxc-nix-builder) (push) Has been cancelled
CI / Build and Publish Documentation (push) Has been cancelled
CI / Format Check (push) Has been cancelled
77 lines
2.3 KiB
Nix
77 lines
2.3 KiB
Nix
# ============================================================================
|
|
# Windows Subsystem for Linux (WSL) Configuration
|
|
# ============================================================================
|
|
# Configuration for NixOS running in WSL2 on Windows.
|
|
# Integrates with nixos-wsl for WSL-specific functionality.
|
|
|
|
{
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.athenix.hw.nix-wsl;
|
|
in
|
|
{
|
|
options.athenix.hw.nix-wsl = mkOption {
|
|
type = types.submodule {
|
|
options = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = "Enable Windows Subsystem for Linux hardware configuration.";
|
|
};
|
|
};
|
|
};
|
|
default = { };
|
|
description = "WSL hardware type configuration.";
|
|
};
|
|
|
|
# WSL user option (at module level, not inside config)
|
|
options.athenix.host.wsl.user = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "engr-ugaif";
|
|
description = ''
|
|
The default user to automatically log in as when starting WSL.
|
|
|
|
This user must be enabled via athenix.users.<username>.enable = true.
|
|
Tip: Use athenix.forUser = "username" as a shortcut to set both.
|
|
'';
|
|
example = "alice";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
# ========== WSL Configuration ==========
|
|
wsl.enable = true;
|
|
# Use forUser if set, otherwise fall back to wsl.user option
|
|
wsl.defaultUser =
|
|
if config.athenix.forUser != null then config.athenix.forUser else config.athenix.host.wsl.user;
|
|
|
|
# ========== Software Profile ==========
|
|
athenix.sw.enable = lib.mkDefault true;
|
|
athenix.sw.headless.enable = lib.mkDefault true;
|
|
|
|
# ========== Remote Development ==========
|
|
services.vscode-server.enable = true;
|
|
|
|
# ========== Disable Irrelevant Systems ==========
|
|
# WSL doesn't use traditional boot or disk management
|
|
disko.enableConfig = lib.mkForce false;
|
|
boot.loader.systemd-boot.enable = lib.mkForce false;
|
|
boot.loader.grub.enable = lib.mkForce false;
|
|
|
|
# WSL manages its own networking
|
|
systemd.network.enable = lib.mkForce false;
|
|
|
|
# Provide dummy values for required options from boot.nix
|
|
athenix.host.filesystem.device = "/dev/null";
|
|
athenix.host.filesystem.swapSize = "0G";
|
|
|
|
# WSL doesn't use installer ISOs
|
|
athenix.host.buildMethods = lib.mkDefault [ ];
|
|
};
|
|
}
|