Files
nixos/hosts/fw/modules/vscode-server.nix

40 lines
896 B
Nix

{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";
}];
};
}