mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-06 21:17:14 -06:00
64 lines
1.3 KiB
Nix
Executable file
64 lines
1.3 KiB
Nix
Executable file
{ flake, config, ... }:
|
|
let
|
|
inherit (flake.config.services.instances) firefly-iii;
|
|
inherit (flake.config.machines.devices) ceres;
|
|
service = firefly-iii;
|
|
in
|
|
{
|
|
services = {
|
|
firefly-iii = {
|
|
enable = true;
|
|
dataDir = service.paths.path0;
|
|
settings = {
|
|
DB_CONNECTION = "pgsql";
|
|
APP_KEY_FILE = config.sops.secrets."${service.name}-pass".path;
|
|
};
|
|
};
|
|
firefly-iii-data-importer = {
|
|
enable = true;
|
|
};
|
|
};
|
|
sops =
|
|
let
|
|
sopsPath = secret: {
|
|
path = "${service.sops.path0}/${service.name}-${secret}";
|
|
owner = service.name;
|
|
mode = "600";
|
|
};
|
|
in
|
|
{
|
|
secrets = builtins.listToAttrs (
|
|
map
|
|
(secret: {
|
|
name = "${service.name}-${secret}";
|
|
value = sopsPath secret;
|
|
})
|
|
[
|
|
"pass"
|
|
]
|
|
);
|
|
};
|
|
|
|
fileSystems."/var/lib/${service.name}" = {
|
|
device = service.paths.path0;
|
|
fsType = "none";
|
|
options = [
|
|
"bind"
|
|
];
|
|
depends = [
|
|
ceres.storage0.mount
|
|
];
|
|
};
|
|
|
|
systemd.tmpfiles.rules = [
|
|
"Z ${service.paths.path0} 755 ${service.name} ${service.name} -"
|
|
"Z ${service.sops.path0} 755 ${service.name} ${service.name} -"
|
|
];
|
|
|
|
networking = {
|
|
firewall.allowedTCPPorts = [
|
|
8080
|
|
8081
|
|
];
|
|
};
|
|
}
|