feat: add ghq configuration

This commit is contained in:
Yorick Barbanneau 2024-04-10 01:20:03 +02:00
parent 2203b49339
commit 8877cdee96
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,27 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.ghq;
in
{
options.modules.cli.ghq = {
enable = mkEnableOption "enable ghq";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
ghq
fzf
];
programs.git.extraConfig = {
ghq = {
root = "~/code";
};
};
home.shellAliases = {
# thanks jdauliac for the tip
g = "cd $(${pkgs.ghq}/bin/ghq root)/$(${pkgs.ghq}/bin/ghq list | ${pkgs.fzf}/bin/fzf)";
};
};
}