mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 21:42:16 -06:00
feat: added firefly-iii
This commit is contained in:
parent
509893c072
commit
9f8af5558c
3 changed files with 9 additions and 10 deletions
64
modules/nixos/services/firefly-iii/default.nix
Executable file
64
modules/nixos/services/firefly-iii/default.nix
Executable file
|
|
@ -0,0 +1,64 @@
|
|||
{ 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
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue