-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switch to pkgs.nix-based alloy module & package (#17)
* feat: switch to pkgs.nix-based alloy module & package * fix: include extra ports in firewall for alloy, formatting fixes * feat: update flake lockfile * feat: update alloy configs * fix: pathing issue in alloy grafana cloud module import * feat: update gc-fwd config * feat: update generic alloy config * feat: remove cachix-agent * fix: update flake.lock
- Loading branch information
Showing
12 changed files
with
170 additions
and
120 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,18 @@ | ||
{...}: { | ||
# see TODO further down | ||
imports = [../docker]; | ||
{ pkgs-nix, pkgs, ... }: { | ||
imports = [ pkgs-nix.nixosModules.alloy ]; | ||
|
||
environment.etc."alloy/config.alloy" = { | ||
source = ./config.alloy; | ||
mode = "0440"; | ||
user = "root"; | ||
}; | ||
|
||
# TODO: Replace this once there's an Alloy package merged into Nixpkgs | ||
# https://github.com/NixOS/nixpkgs/pull/306048 | ||
virtualisation.oci-containers.containers.alloy = { | ||
autoStart = true; | ||
image = "grafana/alloy:v1.0.0"; | ||
|
||
services.alloy = { | ||
enable = true; | ||
package = pkgs-nix.packages.${pkgs.system}.alloy; | ||
openFirewall = true; | ||
configPath = "/etc/alloy"; | ||
group = "root"; | ||
user = "root"; | ||
|
||
ports = [ | ||
"12345:12345" | ||
]; | ||
|
||
cmd = [ | ||
"run" | ||
"--server.http.listen-addr=0.0.0.0:12345" | ||
"--storage.path=/var/lib/alloy/data" | ||
"--stability.level=public-preview" | ||
|
||
# we give a path to the directory so it loads every file, instead of | ||
# one config file. this allows us to add extra configuration in other | ||
# mixins. | ||
"/etc/alloy" | ||
]; | ||
|
||
volumes = [ | ||
# Alloy | ||
"/var/log:/var/log:ro" | ||
"/etc/alloy:/etc/alloy:ro" | ||
|
||
"/var/lib/alloy/data" | ||
|
||
# Node Exporter | ||
"/proc:/host/proc:ro" | ||
"/sys:/host/sys:ro" | ||
"/run/udev/data:/host/run/udev/data:ro" | ||
"/:/rootfs:ro" | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{...}: { | ||
{ ... }: { | ||
virtualisation.docker.enable = true; | ||
virtualisation.oci-containers.backend = "docker"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.