feat: Add wsl profiles

This commit is contained in:
UGA Innovation Factory
2025-12-11 17:42:17 -05:00
committed by Hunter Halloran
parent da9b4cf67a
commit 4275b4cb37
5 changed files with 91 additions and 0 deletions

39
flake.lock generated
View File

@@ -142,6 +142,22 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1765121682,
"narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@@ -462,6 +478,28 @@
"type": "github"
}
},
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1765483419,
"narHash": "sha256-w6wznH1lBzlSH3+pWDkE+L6xA0F02drFAzu2E7PD/Jo=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "0c040f28b44b18e0d4240e027096078e34dbb029",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "main",
"repo": "NixOS-WSL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1732981179,
@@ -574,6 +612,7 @@
"lazyvim-nixvim": "lazyvim-nixvim",
"nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_2",
"nixpkgs-old-kernel": "nixpkgs-old-kernel",
"vscode-server": "vscode-server"

View File

@@ -47,6 +47,12 @@
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
# WSL Support
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{

28
hosts/types/nix-wsl.nix Normal file
View File

@@ -0,0 +1,28 @@
{ inputs, ... }:
[
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";
# Fix for VS Code Server in WSL if needed, though vscode-server input exists
services.vscode-server.enable = true;
# 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";
})
]

View File

@@ -61,6 +61,16 @@
};
};
# WSL Configuration
nix-wsl = {
count = 1;
devices = {
"1" = {
hostname = "nix-wsl-alireza";
};
};
};
# Ephemeral Configuration (Live ISO / Netboot)
nix-ephemeral.count = 1;
}

View File

@@ -38,5 +38,13 @@
# Example of using an external flake for configuration:
# flakeUrl = "github:hdh20267/dotfiles";
};
sv22900 = {
description = "Alireza Vaezi";
extraGroups = [
"networkmanager"
"wheel"
];
shell = pkgs.zsh;
};
};
}