treewide: add missing package option

Provide more customization to the binary to be installed.
This commit is contained in:
Austin Horstman 2025-03-30 11:43:00 -05:00
parent fcdd04e0f9
commit 107352dde4
27 changed files with 111 additions and 48 deletions

View file

@ -23,6 +23,8 @@ in {
options.programs.translate-shell = {
enable = lib.mkEnableOption "translate-shell";
package = lib.mkPackageOption pkgs "translate-shell" { nullable = true; };
settings = lib.mkOption {
type = with lib.types; attrsOf (oneOf [ bool str (listOf str) ]);
default = { };
@ -40,7 +42,7 @@ in {
};
config = lib.mkIf cfg.enable {
home.packages = [ pkgs.translate-shell ];
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."translate-shell/init.trans" =
lib.mkIf (cfg.settings != { }) { text = "{${toKeyValue cfg.settings}}"; };