adding beszel agents
This commit is contained in:
parent
53bb2eda92
commit
47ef50388a
9 changed files with 280 additions and 11 deletions
67
flakes/beszel/flake.nix
Normal file
67
flakes/beszel/flake.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
inputs = {
|
||||
beszel-nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
beszel-nixpkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
nixosModules = {
|
||||
hub = { ... }: { };
|
||||
agent =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
declaration = "services/monitoring/beszel-agent.nix";
|
||||
nixpkgs = beszel-nixpkgs;
|
||||
beszelPkgs = import nixpkgs {
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
};
|
||||
in
|
||||
{
|
||||
disabledModules = [ declaration ];
|
||||
imports = [ "${nixpkgs}/nixos/modules/${declaration}" ];
|
||||
options.beszelAgent = {
|
||||
listen = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The listen:port address for agent";
|
||||
};
|
||||
token = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The token for agent";
|
||||
};
|
||||
key = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The public key for hub";
|
||||
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDcAr8fbW4XyfL/tCMeMtD+Ou/FFywCNfsHdyvYs3qXf";
|
||||
};
|
||||
hub = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The hub url";
|
||||
default = "http://100.64.0.13:8090";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
services.beszel.agent = {
|
||||
package = beszelPkgs.beszel;
|
||||
enable = true;
|
||||
environment = {
|
||||
SYSTEM_NAME = config.networking.hostName;
|
||||
LISTEN = config.beszelAgent.listen;
|
||||
HUB_URL = config.beszelAgent.hub;
|
||||
TOKEN = config.beszelAgent.token;
|
||||
KEY = config.beszelAgent.key;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue