fix: make module work and add instructions for using

This commit is contained in:
TheWanderingCrow 2025-12-22 15:12:22 -05:00
parent 6636a7cb3a
commit 700659ff60
3 changed files with 54 additions and 44 deletions

View file

@ -12,6 +12,8 @@ inputs.actualbudget-report.url = "git+https://git.wanderingcrow.net/TheWandering
Then in your configuration (using sops-nix, you will need to adjust it if you use agenix or alternatives): Then in your configuration (using sops-nix, you will need to adjust it if you use agenix or alternatives):
```nix ```nix
nixpkgs.overlays = [ inputs.actualbudget-report.overlays.default ];
imports = [ imports = [
inputs.actualbudget-report.nixosModules.default; inputs.actualbudget-report.nixosModules.default;
]; ];

View file

@ -7,44 +7,52 @@
}; };
outputs = outputs =
inputs@{ flake-parts, ... }: inputs@{
flake-parts.lib.mkFlake { inherit inputs; } { self,
systems = [ flake-parts,
"x86_64-linux" ...
"aarch64-linux" }:
"aarch64-darwin" flake-parts.lib.mkFlake
"x86_64-darwin" {
]; inherit inputs;
flake.nixosModules = { }
default = ./modules/actualbudget-report; {
}; imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
perSystem = systems = [
{ "x86_64-linux"
config, "aarch64-linux"
self', "aarch64-darwin"
inputs', "x86_64-darwin"
pkgs, ];
system, flake.nixosModules.default = ./modules/actualbudget-report;
... perSystem =
}: {
{ config,
packages.default = pkgs.buildGoModule { self',
name = "actualbudget-report"; inputs',
src = pkgs.fetchFromGitea { pkgs,
domain = "git.wanderingcrow.net"; system,
owner = "TheWanderingCrow"; ...
repo = "actualbudget-report"; }:
rev = "v0.1"; {
hash = "sha256-1Z3+Efx0MCsZhfz49nKsdaWgyVt9+7kekwgfQyaYUxQ="; overlayAttrs = { inherit (config.packages) actualbudget-report; };
packages.actualbudget-report = pkgs.buildGoModule {
name = "actualbudget-report";
src = pkgs.fetchFromGitea {
domain = "git.wanderingcrow.net";
owner = "TheWanderingCrow";
repo = "actualbudget-report";
rev = "v0.1";
hash = "sha256-1Z3+Efx0MCsZhfz49nKsdaWgyVt9+7kekwgfQyaYUxQ=";
};
vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs=";
};
devShells.default = pkgs.mkShell {
ENVIRONMENT = "dev";
nativeBuildInputs = with pkgs; [
devenv
];
}; };
vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs=";
}; };
devShells.default = pkgs.mkShell { };
ENVIRONMENT = "dev";
nativeBuildInputs = with pkgs; [
devenv
];
};
};
};
} }

View file

@ -1,8 +1,8 @@
{ {
pkgs,
config, config,
options, options,
lib, lib,
pkgs,
... ...
}: }:
let let
@ -10,8 +10,8 @@ let
opt = options.services.actualbudget-report; opt = options.services.actualbudget-report;
inherit (lib) inherit (lib)
mkEnableOption mkEnableOption
mkOption
mkPackageOption mkPackageOption
mkOption
mkIf mkIf
types types
; ;
@ -20,12 +20,12 @@ in
options = { options = {
services.actualbudget-report = { services.actualbudget-report = {
enable = mkEnableOption "Actualbudget email reports"; enable = mkEnableOption "Actualbudget email reports";
package = mkPackageOption pkgs.default; interval = mkOption {
interval = {
type = types.str; type = types.str;
default = "Sun 12:00:00"; default = "Sun 12:00:00";
description = "systemd-timer OnCalendar legal string for sending reports."; description = "systemd-timer OnCalendar legal string for sending reports.";
}; };
package = mkPackageOption pkgs "actualbudget-report" { };
environmentFile = mkOption { environmentFile = mkOption {
type = types.path; type = types.path;
default = ""; default = "";
@ -39,11 +39,11 @@ in
description = "Actualbudget report sender service"; description = "Actualbudget report sender service";
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = "${cfg.package}/bin/actualbudget-report"; ExecStart = "${pkgs.actualbudget-report}/bin/actualbudget-report";
EnvironmentFile = cfg.environmentFile; EnvironmentFile = cfg.environmentFile;
}; };
}; };
systemd.timers.flamesite-backup = { systemd.timers.actualbudget-report = {
enable = true; enable = true;
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = {