add vscode server microvm and update user configurations

This commit is contained in:
2025-03-01 15:31:17 +01:00
parent 386b70314d
commit 3b043eaf6d
6 changed files with 62 additions and 4 deletions

View File

@@ -29,6 +29,7 @@
# microvm
./modules/microvm.nix
./modules/gitea-vm.nix
./modules/vscode-server.nix # Add VS Code Server microvm
# web
./modules/web

View File

@@ -0,0 +1,40 @@
{config, pkgs, lib, ...}:
let
hostname = "vscode-server";
unstable = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz") {
config = config.nixpkgs.config;
system = pkgs.system;
};
in {
microvm.vms.${hostname} = {
autostart = true;
config = { config, pkgs, ... }: {
networking.hostName = hostname;
services.code-server = {
enable = true;
host = "0.0.0.0";
port = 8080;
auth = "none";
extensions = with pkgs.vscode-extensions; [
github.copilot
ms-azuretools.vscode-docker
];
};
environment.systemPackages = [
unstable.ddev
];
# Docker is required for ddev
virtualisation.docker.enable = true;
};
interfaces = [{
type = "tap";
id = "vm-${hostname}";
mac = "02:00:00:00:01:01";
}];
};
}