{
  pkgs,
  config,
  lib,
  ...
}:
let
  cfg = config.machine.code-server;
in
with lib;
mkIf cfg.enable {
  services.code-server = {
    enable = cfg.enable;
    port = cfg.port;
    hashedPassword = cfg.hashedPassword;
    user = cfg.user;
    host = "127.0.0.1";
    disableTelemetry = true;
    disableUpdateCheck = true;
    disableWorkspaceTrust = true;
    package = pkgs.vscode-with-extensions.override {
      vscode = pkgs.code-server;
      vscodeExtensions =
        (with pkgs.vscode-extensions; [
          rust-lang.rust-analyzer
          fill-labs.dependi
          ms-python.black-formatter
          ms-python.python
          ms-python.isort
          ms-python.mypy-type-checker
          intellsmi.comment-translate
          editorconfig.editorconfig
          dbaeumer.vscode-eslint
          davidanson.vscode-markdownlint
          yzhang.markdown-all-in-one
          jnoortheen.nix-ide
          ziglang.vscode-zig
          bbenoist.nix
        ])
        ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
          {
            name = "purpleVoid";
            publisher = "Rej";
            version = "1.0.3";
            sha256 = "oCZ2N8j2U0xGvechD7DlW64KiL0eSDKYwniYft0kVu4=";
          }
        ];
    };
  };
}
