feat: hledger test

This commit is contained in:
Nick 2025-01-21 21:58:09 -06:00
parent c67e864d40
commit c82dd5e36f
4 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{ instancesFunctions }:
let
inherit (instancesFunctions)
domain0
servicePath
sslPath
sopsPath
;
hledgerLabel = "Hledger";
hledgerName = "hledger";
hledgerSubdomain = "source";
in
{
label = hledgerLabel;
name = hledgerName;
email = {
address0 = "noreply@${domain0}";
};
sops = {
path0 = "${sopsPath}/${hledgerName}";
};
subdomain = hledgerSubdomain;
paths = {
path0 = "${servicePath}/${hledgerLabel}";
};
ports = {
port0 = 5000;
};
ssl = {
cert = "${sslPath}/${hledgerSubdomain}.${domain0}/fullchain.pem";
key = "${sslPath}/${hledgerSubdomain}.${domain0}/key.pem";
};
}

View file

@ -20,6 +20,7 @@ let
kdenlive = "(org.kde.kdenlive)"; kdenlive = "(org.kde.kdenlive)";
shotcut = "(shotcut)"; shotcut = "(shotcut)";
scrcpy = "(.scrcpy-wrapped)"; scrcpy = "(.scrcpy-wrapped)";
battle = "(.*Battle.net.*)";
maxsizeWindows = [ maxsizeWindows = [
"maxsize 720 400, class:^${blueman}$" "maxsize 720 400, class:^${blueman}$"
@ -34,6 +35,8 @@ let
"maxsize 720 400, title:^${picture}$" "maxsize 720 400, title:^${picture}$"
"maxsize 720 400, title:^${save}$" "maxsize 720 400, title:^${save}$"
"maxsize 720 400, title:^${discord-popout}$" "maxsize 720 400, title:^${discord-popout}$"
"maxsize 1280 720, title:^${battle}$"
"minsize 1280 720, title:^${battle}$"
]; ];
floatWindows = builtins.map (x: "float, " + x) [ floatWindows = builtins.map (x: "float, " + x) [
@ -50,6 +53,7 @@ let
"title:^(${discord-popout})$" "title:^(${discord-popout})$"
"title:^${bitwarden}$" "title:^${bitwarden}$"
"title:^${save}$" "title:^${save}$"
"title:^${battle}$"
]; ];
pinWindows = builtins.map (x: "pin, " + x) [ pinWindows = builtins.map (x: "pin, " + x) [

View file

@ -44,6 +44,7 @@ in
"ollama" "ollama"
"syncthing" "syncthing"
"vaultwarden" "vaultwarden"
"hledger"
] ]
) )
++ (map ++ (map

View 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} -"
];
}