1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-22 18:29:39 +01:00

lazysql: add module (#7231)

This commit is contained in:
Aguirre Matteo 2025-06-08 04:51:28 +00:00 committed by GitHub
parent 980aece33a
commit bd8946c773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 101 additions and 0 deletions

View file

@ -174,6 +174,7 @@ let
./programs/lapce.nix
./programs/lazydocker.nix
./programs/lazygit.nix
./programs/lazysql.nix
./programs/ledger.nix
./programs/less.nix
./programs/lesspipe.nix

View file

@ -0,0 +1,41 @@
{
lib,
pkgs,
config,
...
}:
let
inherit (lib)
mkIf
mkEnableOption
mkPackageOption
mkOption
;
cfg = config.programs.lazysql;
formatter = pkgs.formats.toml { };
in
{
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
options.programs.lazysql = {
enable = mkEnableOption "lazysql";
package = mkPackageOption pkgs "lazysql" { nullable = true; };
settings = mkOption {
type = formatter.type;
default = { };
example = { };
description = ''
Configuration settings for lazysql.
'';
};
};
config = mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."lazysql/config.toml" = mkIf (cfg.settings != { }) {
source = formatter.generate "lazysql-config" cfg.settings;
};
};
}