1
0
Fork 0
generated from me/nix-flake-template
invoice-manager/flake-module.nix
2025-08-13 00:03:38 -05:00

48 lines
1.2 KiB
Nix

# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
#
# SPDX-License-Identifier: LGPL-3.0-or-later
{
flake-parts-lib,
inputs,
lib,
...
}:
{
imports = [ inputs.flake-lib.flakeModule ];
options.perSystem = flake-parts-lib.mkPerSystemOption (
{ config, pkgs, ... }:
{
options.invoice.company = lib.mkOption {
description = ''
Company for invoice.
'';
type = lib.types.str;
default = "";
};
config = {
settings.reuse.enable = false;
devshells.default = {
packages = [ pkgs.timewarrior ];
env = [
{
name = "TIMEWARRIORDB";
eval = "\"$(\"${pkgs.git}/bin/git\" rev-parse --show-toplevel)/timewarrior\"";
}
];
devshell = {
motd = ''
{202} Invoice Manager${
if config.invoice.company == "" then "" else " (${config.invoice.company})"
}{reset}
$(type -p menu &>/dev/null && menu)
'';
name = "Invoice Manager${
if config.invoice.company == "" then "" else " ${config.invoice.company}"
}";
};
};
};
}
);
}