1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 02:51:08 +01:00

chore: format with alejandra

This commit is contained in:
2022-03-10 21:52:12 +01:00
parent 13727abfd6
commit d37e90cb97
159 changed files with 4239 additions and 3405 deletions

View File

@@ -1,6 +1,10 @@
{ config, lib, pkgs, ... }:
with lib;
let
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.niveum.hledger;
hledger-git = pkgs.writers.writeDashBin "hledger-git" ''
LEDGER_DIR="$(dirname $LEDGER_FILE)"
@@ -39,14 +43,14 @@ in {
default = "127.0.0.1";
};
capabilities = mkOption {
type = types.listOf (types.enum [ "view" "add" "manage" ]);
default = [ "view" "add" ];
type = types.listOf (types.enum ["view" "add" "manage"]);
default = ["view" "add"];
};
flags = mkOption {
type = types.listOf types.str;
default = [ ];
default = [];
};
user = mkOption { type = types.attrs; };
user = mkOption {type = types.attrs;};
package = mkOption {
type = types.package;
default = pkgs.hledger-web;
@@ -55,22 +59,22 @@ in {
};
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package hledger-git hledger-edit ];
environment.systemPackages = [cfg.package hledger-git hledger-edit];
environment.variables.LEDGER_FILE =
mkIf (cfg.ledgerFile != null) cfg.ledgerFile;
systemd.services.hledger-web = mkIf cfg.server.enable {
description = "hledger server";
wantedBy = [ "multi-user.target" ];
wantedBy = ["multi-user.target"];
serviceConfig = {
Restart = "always";
ExecStart = ''
${cfg.server.package}/bin/hledger-web \
--port=${toString cfg.server.port} \
--host=${cfg.server.host} \
--capabilities=${concatStringsSep "," cfg.server.capabilities} \
${concatStringsSep " " cfg.server.flags}
--port=${toString cfg.server.port} \
--host=${cfg.server.host} \
--capabilities=${concatStringsSep "," cfg.server.capabilities} \
${concatStringsSep " " cfg.server.flags}
'';
User = cfg.server.user.name;
PrivateTemp = true;