fix: make module work and add instructions for using
This commit is contained in:
parent
6636a7cb3a
commit
700659ff60
3 changed files with 54 additions and 44 deletions
|
|
@ -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):
|
||||
```nix
|
||||
nixpkgs.overlays = [ inputs.actualbudget-report.overlays.default ];
|
||||
|
||||
imports = [
|
||||
inputs.actualbudget-report.nixosModules.default;
|
||||
];
|
||||
|
|
|
|||
20
flake.nix
20
flake.nix
|
|
@ -7,17 +7,24 @@
|
|||
};
|
||||
|
||||
outputs =
|
||||
inputs@{ flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
inputs@{
|
||||
self,
|
||||
flake-parts,
|
||||
...
|
||||
}:
|
||||
flake-parts.lib.mkFlake
|
||||
{
|
||||
inherit inputs;
|
||||
}
|
||||
{
|
||||
imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
flake.nixosModules = {
|
||||
default = ./modules/actualbudget-report;
|
||||
};
|
||||
flake.nixosModules.default = ./modules/actualbudget-report;
|
||||
perSystem =
|
||||
{
|
||||
config,
|
||||
|
|
@ -28,7 +35,8 @@
|
|||
...
|
||||
}:
|
||||
{
|
||||
packages.default = pkgs.buildGoModule {
|
||||
overlayAttrs = { inherit (config.packages) actualbudget-report; };
|
||||
packages.actualbudget-report = pkgs.buildGoModule {
|
||||
name = "actualbudget-report";
|
||||
src = pkgs.fetchFromGitea {
|
||||
domain = "git.wanderingcrow.net";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
options,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
|
@ -10,8 +10,8 @@ let
|
|||
opt = options.services.actualbudget-report;
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
mkIf
|
||||
types
|
||||
;
|
||||
|
|
@ -20,12 +20,12 @@ in
|
|||
options = {
|
||||
services.actualbudget-report = {
|
||||
enable = mkEnableOption "Actualbudget email reports";
|
||||
package = mkPackageOption pkgs.default;
|
||||
interval = {
|
||||
interval = mkOption {
|
||||
type = types.str;
|
||||
default = "Sun 12:00:00";
|
||||
description = "systemd-timer OnCalendar legal string for sending reports.";
|
||||
};
|
||||
package = mkPackageOption pkgs "actualbudget-report" { };
|
||||
environmentFile = mkOption {
|
||||
type = types.path;
|
||||
default = "";
|
||||
|
|
@ -39,11 +39,11 @@ in
|
|||
description = "Actualbudget report sender service";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${cfg.package}/bin/actualbudget-report";
|
||||
ExecStart = "${pkgs.actualbudget-report}/bin/actualbudget-report";
|
||||
EnvironmentFile = cfg.environmentFile;
|
||||
};
|
||||
};
|
||||
systemd.timers.flamesite-backup = {
|
||||
systemd.timers.actualbudget-report = {
|
||||
enable = true;
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue