41 lines
856 B
Nix
41 lines
856 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 = {
|
|
inherit (cfg) port extraEnvironment;
|
|
enable = true;
|
|
user = "admin";
|
|
group = "jallen-nas";
|
|
host = cfg.listenAddress;
|
|
auth = "none"; # "password"
|
|
disableTelemetry = true;
|
|
disableUpdateCheck = true;
|
|
extraGroups = [
|
|
"admin"
|
|
"wheel"
|
|
];
|
|
}
|
|
// optionalAttrs (cfg.hashedPassword != null) {
|
|
inherit (cfg) hashedPassword;
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
imports = [ codeServerConfig ];
|
|
}
|