Files
nix-config/modules/nixos/services/code-server/default.nix
mjallen18 d981fb20c2 fmt ++
2025-12-23 21:04:21 -06:00

42 lines
892 B
Nix

{
config,
lib,
namespace,
...
}:
with lib;
let
name = "code-server";
cfg = config.${namespace}.services.${name};
codeServerConfig = lib.${namespace}.mkModule {
inherit config name;
description = "vscode server";
options = { };
moduleConfig = {
# Configure the standard NixOS code-server service
services.code-server = {
enable = true;
port = cfg.port;
user = "admin";
group = "jallen-nas";
host = cfg.listenAddress;
auth = "none"; # "password"
disableTelemetry = true;
disableUpdateCheck = true;
extraEnvironment = cfg.extraEnvironment;
extraGroups = [
"admin"
"wheel"
];
}
// optionalAttrs (cfg.hashedPassword != null) {
hashedPassword = cfg.hashedPassword;
};
};
};
in
{
imports = [ codeServerConfig ];
}