Add code-server, various cleanups

This commit is contained in:
Felix Albrigtsen 2023-04-19 10:48:16 +02:00
parent 34cbe2f460
commit f14628114e
4 changed files with 28 additions and 10 deletions

View File

@ -7,12 +7,13 @@
../../common/metrics-exporters.nix
./hardware-configuration.nix
./filesystems.nix
#./vms.nix
./vms.nix
./services/nginx
./services/metrics
./services/flame.nix
./services/jellyfin.nix
./services/code-server.nix
# TODO:
# x Boot
# x Mount ZFS

View File

@ -0,0 +1,16 @@
{ config, pkgs, lib, ... }:
let
cfg = config.services.code-server;
in {
services.code-server = {
enable = true;
host = "127.0.1.2";
port = 4444;
};
services.nginx.virtualHosts."code.home.feal.no" = {
locations."/" = {
proxyPass = "http://127.0.1.2:${toString cfg.port}";
proxyWebsockets = true;
};
};
}

View File

@ -4,12 +4,13 @@ let
in {
# Jellyfin - Media Streaming platform
services.jellyfin.enable = true;
networking.firewall.allowedTCPPorts = [ 8096 ];
users.users.${config.services.jellyfin.user}.extraGroups = [ "video" "render" ];
systemd.services.jellyfin.serviceConfig = {
DeviceAllow = lib.mkForce [ "/dev/dri/card0" ];
};
services.nginx.virtualHosts."${domainName}" = {
extraConfig = ''
#add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
location = / {

View File

@ -1,7 +1,7 @@
{ config, pkgs, ... }:
let
cfg = config.services.loki;
saveDirectory = "/tank/var/lib/loki";
in {
services.loki = {
enable = true;
@ -16,7 +16,7 @@ in {
ingester = {
wal = {
enabled = true;
dir = "/var/lib/loki/wal";
dir = "${saveDirectory}/wal";
};
lifecycler = {
address = "127.0.0.1";
@ -48,13 +48,13 @@ in {
storage_config = {
boltdb_shipper = {
active_index_directory = "/var/lib/loki/boltdb-shipper-index";
cache_location = "/var/lib/loki/boltdb-shipper-cache";
active_index_directory = "${saveDirectory}/boltdb-shipper-index";
cache_location = "${saveDirectory}/boltdb-shipper-cache";
shared_store = "filesystem";
cache_ttl = "24h";
};
filesystem = {
directory = "/var/lib/loki/chunks";
directory = "${saveDirectory}/chunks";
};
};
@ -65,7 +65,7 @@ in {
};
compactor = {
working_directory = "/var/lib/loki/compactor";
working_directory = "${saveDirectory}/compactor";
shared_store = "filesystem";
};
};