Compare commits
No commits in common. "5fa908463eb1db245acffdcc1166ff97b381e39d" and "a6d0cd6e62ac8250a080a436fe2851e402757ac9" have entirely different histories.
5fa908463e
...
a6d0cd6e62
|
@ -1,9 +0,0 @@
|
||||||
root = true
|
|
||||||
|
|
||||||
[*.nix]
|
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
trim_trailing_whitespace = true
|
|
|
@ -456,12 +456,6 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 1995;
|
port = 1995;
|
||||||
};
|
};
|
||||||
|
|
||||||
code-server = {
|
|
||||||
enable = true;
|
|
||||||
domain = "dev-firepit.oat.zone";
|
|
||||||
port = 4444;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
{ config, lib, pkgs, options, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.code-server;
|
|
||||||
in {
|
|
||||||
options.modules.services.code-server = {
|
|
||||||
enable = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
domain = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "dev-firepit.oat.zone";
|
|
||||||
};
|
|
||||||
port = mkOption {
|
|
||||||
type = types.int;
|
|
||||||
default = 4444;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
services = {
|
|
||||||
code-server = {
|
|
||||||
enable = true;
|
|
||||||
port = cfg.port;
|
|
||||||
# temporary
|
|
||||||
auth = "password";
|
|
||||||
# temporary; be sure to remove trailing newline
|
|
||||||
hashedPassword = builtins.readFile /etc/code-server-password;
|
|
||||||
|
|
||||||
extraPackages = with pkgs; [ git nix ];
|
|
||||||
};
|
|
||||||
|
|
||||||
nginx.virtualHosts."${cfg.domain}" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
locations."= /robots.txt" = {
|
|
||||||
extraConfig = ''
|
|
||||||
add_header Content-Type text/plain;
|
|
||||||
return 200 "User-agent: *\nDisallow: /\n";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.code-server = {
|
|
||||||
extraGroups = [ "nix-users" "dotfiles" ];
|
|
||||||
shell = pkgs.unstable.fish;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue