nixos/lazygit: init
Update nixos/modules/programs/lazygit.nix Co-authored-by: Aleksana <alexander.huang.y@gmail.com> Update nixos/modules/programs/lazygit.nix Co-authored-by: Aleksana <alexander.huang.y@gmail.com>
This commit is contained in:
parent
4ab65fb809
commit
89db988ed2
2 changed files with 38 additions and 0 deletions
|
@ -212,6 +212,7 @@
|
|||
./programs/kbdlight.nix
|
||||
./programs/kclock.nix
|
||||
./programs/kdeconnect.nix
|
||||
./programs/lazygit.nix
|
||||
./programs/less.nix
|
||||
./programs/liboping.nix
|
||||
./programs/light.nix
|
||||
|
|
37
nixos/modules/programs/lazygit.nix
Normal file
37
nixos/modules/programs/lazygit.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.programs.lazygit;
|
||||
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
in
|
||||
{
|
||||
options.programs.lazygit = {
|
||||
enable = lib.mkEnableOption "lazygit, a simple terminal UI for git commands";
|
||||
|
||||
package = lib.mkPackageOption pkgs "lazygit" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
inherit (settingsFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Lazygit configuration.
|
||||
|
||||
See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md for documentation.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment = {
|
||||
systemPackages = [ cfg.package ];
|
||||
etc = lib.mkIf (cfg.settings != { }) {
|
||||
"xdg/lazygit/config.yml".source = settingsFormat.generate "lazygit-config.yml" cfg.settings;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
maintainers = with lib.maintainers; [ linsui ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue