nix/modules/home-manager/cli/ghq/default.nix

27 lines
509 B
Nix

{ 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)";
};
};
}