better cleaner containers

This commit is contained in:
ari committed 2026-06-28 16:05:54 -04:00
1 parent d9b984db7f
commit 4bd849e534
4 files changed
+20 -5

No files matched your search

+11 -1
View File
@@ -181,7 +181,10 @@ in
services.hermes = {
image = "nousresearch/hermes-agent";
command = [ "gateway" "run" ];
ports = [ "${toString ports.hermes}:8642" ];
ports = [
"${toString ports.hermes}:8642"
"${toString ports.hermesDashboard}:9119"
];
volumes = [ "/var/lib/hermes:/opt/data" ];
environmentFiles = [ config.age.secrets.hermes-env.path ];
environment = {
@@ -193,6 +196,13 @@ in
"/opt/data/config.yaml" = ''
terminal:
backend: docker
gateway:
platforms:
telegram:
extra:
status_indicator: true
status_online: "🟢 Online"
status_offline: "🔴 Offline"
'';
};
};
@@ -14,10 +14,12 @@ let
runtimeService = containerLib.runtimeService isDocker;
enabledGroups = lib.filterAttrs (_: g: g.enable) cfg;
optionsModule = import ./options.nix { inherit lib; };
in
{
imports = [ ./options.nix ];
options = optionsModule.options;
config = {
assertions = lib.optionals (enabledGroups != { }) [
@@ -68,13 +68,16 @@ rec {
mkFilesService = groupName: grpCfg: pkgs:
let
filesMap = getAllFiles grpCfg;
scriptFile = pkgs.writeShellScript "write-files-${groupName}" (mkFilesScript groupName grpCfg);
in
lib.optionalAttrs (filesMap != { }) {
"container-services-${groupName}-files" = {
description = "Write custom files for container service group '${groupName}'";
before = [ "container-services-${groupName}.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.bash}/bin/bash -c ${lib.escapeShellArg (mkFilesScript groupName grpCfg)}";
RemainAfterExit = true;
ExecStart = scriptFile;
};
};
};
@@ -27,7 +27,7 @@
# Sanitize a path into a valid filename
pathToFilename = target:
lib.strings.sanitizeDerivationName (
lib.strings.removePrefix "/" target
| > builtins.replaceStrings [ "/" ] [ "-" ]
builtins.replaceStrings [ "/" ] [ "-" ]
(lib.strings.removePrefix "/" target)
);
}