jrnl: modernize

cleanup with lib and other lint warnings

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2025-11-21 20:29:46 -06:00
parent d10a9b16b2
commit 89544bf918

View File

@@ -9,15 +9,16 @@ let
cfg = config.programs.jrnl; cfg = config.programs.jrnl;
yamlFormat = pkgs.formats.yaml { }; yamlFormat = pkgs.formats.yaml { };
in in
with lib;
{ {
meta.maintainers = [ lib.maintainers.matthiasbeyer ];
options.programs.jrnl = { options.programs.jrnl = {
enable = mkEnableOption "jrnl"; enable = lib.mkEnableOption "jrnl";
package = lib.mkPackageOption pkgs "jrnl" { nullable = true; }; package = lib.mkPackageOption pkgs "jrnl" { nullable = true; };
settings = mkOption { settings = lib.mkOption {
type = yamlFormat.type; inherit (yamlFormat) type;
default = { }; default = { };
description = '' description = ''
Configuration for the jrnl binary. Configuration for the jrnl binary.
@@ -27,10 +28,11 @@ with lib;
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ]; home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."jrnl/jrnl.yaml".source = yamlFormat.generate "jrnl.yaml" cfg.settings;
};
meta.maintainers = [ lib.maintainers.matthiasbeyer ]; xdg.configFile."jrnl/jrnl.yaml" = lib.mkIf (cfg.settings != { }) {
source = yamlFormat.generate "jrnl.yaml" cfg.settings;
};
};
} }