diff --git a/hosts/voyager/configuration.nix b/hosts/voyager/configuration.nix index bb5b978..322c11d 100644 --- a/hosts/voyager/configuration.nix +++ b/hosts/voyager/configuration.nix @@ -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 diff --git a/hosts/voyager/services/code-server.nix b/hosts/voyager/services/code-server.nix new file mode 100644 index 0000000..9c818d8 --- /dev/null +++ b/hosts/voyager/services/code-server.nix @@ -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; + }; + }; +} diff --git a/hosts/voyager/services/jellyfin.nix b/hosts/voyager/services/jellyfin.nix index 6016529..0cbc479 100644 --- a/hosts/voyager/services/jellyfin.nix +++ b/hosts/voyager/services/jellyfin.nix @@ -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 = / { diff --git a/hosts/voyager/services/metrics/loki.nix b/hosts/voyager/services/metrics/loki.nix index fc97f07..0038142 100644 --- a/hosts/voyager/services/metrics/loki.nix +++ b/hosts/voyager/services/metrics/loki.nix @@ -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"; }; };