1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-02 23:21:02 +01:00
home-manager/modules/programs/jrnl.nix
Austin Horstman 89544bf918 jrnl: modernize
cleanup with lib and other lint warnings

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-11-22 12:35:42 -06:00

38 lines
871 B
Nix

{
pkgs,
lib,
config,
...
}:
let
cfg = config.programs.jrnl;
yamlFormat = pkgs.formats.yaml { };
in
{
meta.maintainers = [ lib.maintainers.matthiasbeyer ];
options.programs.jrnl = {
enable = lib.mkEnableOption "jrnl";
package = lib.mkPackageOption pkgs "jrnl" { nullable = true; };
settings = lib.mkOption {
inherit (yamlFormat) type;
default = { };
description = ''
Configuration for the jrnl binary.
Available configuration options are described in the jrnl documentation:
<https://jrnl.sh/en/stable/reference-config-file/>.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."jrnl/jrnl.yaml" = lib.mkIf (cfg.settings != { }) {
source = yamlFormat.generate "jrnl.yaml" cfg.settings;
};
};
}