Skip to content

Commit

Permalink
Merge pull request #302559 from linsui/lazygit
Browse files Browse the repository at this point in the history
nixos/lazygit: init
  • Loading branch information
drupol committed Apr 11, 2024
2 parents a0ca280 + 89db988 commit 9034140
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
./programs/kbdlight.nix
./programs/kclock.nix
./programs/kdeconnect.nix
./programs/lazygit.nix
./programs/less.nix
./programs/liboping.nix
./programs/light.nix
Expand Down
37 changes: 37 additions & 0 deletions nixos/modules/programs/lazygit.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}

0 comments on commit 9034140

Please sign in to comment.