This commit is contained in:
John Lancaster
2024-12-02 17:53:37 -06:00
parent 14b6a504e7
commit 92324773ff
2 changed files with 11 additions and 17 deletions

View File

@@ -1,15 +1,5 @@
# nix-docker # [Grafana Loki](https://grafana.com/docs/loki/latest/)
Template for making Nix-based LXC containers in Proxmox to run Docker ## [Loki NixOS Options](https://search.nixos.org/options?sort=relevance&type=packages&query=services.loki)
## NFS Mounts ## [Loki Configuration Examples](https://grafana.com/docs/loki/latest/configure/examples/configuration-examples/)
Needs to be done in a privileged container because AppArmor makes it a pain in the ass
- [Unprivileged LXC containers](https://pve.proxmox.com/wiki/Unprivileged_LXC_containers)
- [Mount NFS inside LXC containers](https://theorangeone.net/posts/mount-nfs-inside-lxc/)
- [How to allow specific Proxmox LXC containers to mount NFS shares on the network?](https://unix.stackexchange.com/questions/450308/how-to-allow-specific-proxmox-lxc-containers-to-mount-nfs-shares-on-the-network)
## Docker
- [Docker on NixOS](https://nixos.wiki/wiki/Docker)

View File

@@ -1,9 +1,13 @@
{ pkgs, userName, ... }: { pkgs, userName, ... }:
let
lokiPort = 3100;
in
{ {
networking.firewall.allowedTCPPorts = [ 3100 ]; networking.firewall.allowedTCPPorts = [ lokiPort ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "loki-check" "curl http://127.0.0.1:3100/ready") (pkgs.writeShellScriptBin "loki-check" "curl http://localhost:3100/ready")
(pkgs.writeShellScriptBin "loki-logs" "journalctl -b -u loki.service -n 25")
]; ];
services.loki = { services.loki = {
@@ -11,8 +15,8 @@
user = "${userName}"; user = "${userName}";
configuration = { configuration = {
server.http_listen_port = 3100; server.http_listen_port = lokiPort;
server.grpc_listen_port = 9096; # server.grpc_listen_port = 9096;
auth_enabled = false; auth_enabled = false;
ingester = { ingester = {