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
d145245648
commit
77f1db64d2
6 changed files with 3 additions and 50 deletions
73
nixos/modules/hledger.nix
Executable file
73
nixos/modules/hledger.nix
Executable file
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
flake,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
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
|
||||
{
|
||||
services = {
|
||||
hledger-web = {
|
||||
enable = true;
|
||||
host = localhost;
|
||||
baseUrl = "https://${host}";
|
||||
stateDir = service.paths.path0;
|
||||
port = service.ports.port0;
|
||||
journalFiles = [
|
||||
".hledger.journal"
|
||||
];
|
||||
allow = "edit";
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
hledger
|
||||
hledger-ui
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
users = {
|
||||
users.${service.name} = {
|
||||
isSystemUser = true;
|
||||
group = service.name;
|
||||
home = service.paths.path0;
|
||||
};
|
||||
groups.${service.name} = { };
|
||||
};
|
||||
|
||||
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 ${service.name} ${service.name} -"
|
||||
];
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
service.ports.port0
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue