Add code-server, various cleanups

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

View File

@ -7,12 +7,13 @@
../../common/metrics-exporters.nix ../../common/metrics-exporters.nix
./hardware-configuration.nix ./hardware-configuration.nix
./filesystems.nix ./filesystems.nix
#./vms.nix ./vms.nix
./services/nginx ./services/nginx
./services/metrics ./services/metrics
./services/flame.nix ./services/flame.nix
./services/jellyfin.nix ./services/jellyfin.nix
./services/code-server.nix
# TODO: # TODO:
# x Boot # x Boot
# x Mount ZFS # 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 { in {
# Jellyfin - Media Streaming platform # Jellyfin - Media Streaming platform
services.jellyfin.enable = true; services.jellyfin.enable = true;
users.users.${config.services.jellyfin.user}.extraGroups = [ "video" "render" ];
networking.firewall.allowedTCPPorts = [ 8096 ]; systemd.services.jellyfin.serviceConfig = {
DeviceAllow = lib.mkForce [ "/dev/dri/card0" ];
};
services.nginx.virtualHosts."${domainName}" = { services.nginx.virtualHosts."${domainName}" = {
extraConfig = '' extraConfig = ''
#add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block"; add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff"; add_header X-Content-Type-Options "nosniff";
location = / { location = / {

View File

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