dotfiles/hosts/h001/containers/homarr.nix
RingOfStorms (Joshua Bell) 0aba3aac80 got grafana working
2025-06-23 22:18:38 -05:00

32 lines
709 B
Nix

{
...
}:
let
name = "homarr";
hostDataDir = "/var/lib/${name}";
v_port = 7575;
in
{
virtualisation.oci-containers.containers = {
"${name}" = {
image = "ghcr.io/homarr-labs/homarr:latest";
ports = [
"127.0.0.1:${toString v_port}:${toString v_port}"
];
volumes = [
"${hostDataDir}:/appdata"
"/var/run/docker.sock:/var/run/docker.sock"
];
environment = {
SECRET_ENCRYPTION_KEY = "0b7e80116a742d16a8f07452a2d9b206b1997d32a6dd2c29cfe4df676e281295";
};
};
};
system.activationScripts."${name}_directories" = ''
mkdir -p ${hostDataDir}
chown -R root:root ${hostDataDir}
chmod -R 777 ${hostDataDir}
'';
}