mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
feat: hledger test
This commit is contained in:
parent
c67e864d40
commit
c82dd5e36f
4 changed files with 95 additions and 0 deletions
56
nixos/modules/services/hledger.nix
Normal file
56
nixos/modules/services/hledger.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
flake,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.people)
|
||||
user0
|
||||
;
|
||||
inherit (flake.config.machines.devices)
|
||||
server
|
||||
;
|
||||
inherit (flake.config.services.instances)
|
||||
hledger
|
||||
web
|
||||
;
|
||||
service = hledger;
|
||||
localhost = web.localhost.address0;
|
||||
host = "${service.subdomain}.${web.domains.url0}";
|
||||
in
|
||||
{
|
||||
hledger-web = {
|
||||
enable = true;
|
||||
host = localhost;
|
||||
baseUrl = host;
|
||||
stateDir = service.paths.path0;
|
||||
port = service.ports.port0;
|
||||
allow = "edit";
|
||||
};
|
||||
|
||||
caddy = {
|
||||
virtualHosts = {
|
||||
"${host}" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy ${localhost}:${toString service.ports.port0}
|
||||
|
||||
tls ${service.ssl.cert} ${service.ssl.key}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/var/lib/${service.name}" = {
|
||||
device = service.paths.path0;
|
||||
fsType = "none";
|
||||
options = [
|
||||
"bind"
|
||||
];
|
||||
depends = [
|
||||
server.storage0.mount
|
||||
];
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"Z ${service.paths.path0} 0755 ${user0} ${user0} -"
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue