move stuff
This commit is contained in:
37
modules/nixos/services/code-server/default.nix
Normal file
37
modules/nixos/services/code-server/default.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.code-server;
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Configure the standard NixOS code-server service
|
||||
services.code-server = {
|
||||
enable = true;
|
||||
port = cfg.port;
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
host = cfg.host;
|
||||
auth = cfg.auth;
|
||||
disableTelemetry = cfg.disableTelemetry;
|
||||
disableUpdateCheck = cfg.disableUpdateCheck;
|
||||
extraEnvironment = cfg.extraEnvironment;
|
||||
}
|
||||
// optionalAttrs (cfg.hashedPassword != null) {
|
||||
hashedPassword = cfg.hashedPassword;
|
||||
};
|
||||
|
||||
# Open firewall for code-server if enabled
|
||||
networking.firewall = mkIf cfg.openFirewall {
|
||||
allowedTCPPorts = [ cfg.port ];
|
||||
allowedUDPPorts = [ cfg.port ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user