1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-30 22:21:02 +01:00
home-manager/modules/programs/pay-respects.nix
Austin Horstman b8bb556ce5 maintainers: remove duplicate HM entries
We can remove duplicate entries and redirect to the nixpkgs entry.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-04 09:20:48 -05:00

66 lines
1.7 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.pay-respects;
payRespectsCmd = lib.getExe cfg.package;
cfgOptions = lib.concatStringsSep " " cfg.options;
in
{
meta.maintainers = [ lib.maintainers.ALameLlama ];
options.programs.pay-respects = {
enable = lib.mkEnableOption "pay-respects";
package = lib.mkPackageOption pkgs "pay-respects" { };
options = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "--alias" ];
example = [
"--alias"
"f"
];
description = ''
List of options to pass to pay-respects <shell>.
'';
};
enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; };
enableFishIntegration = lib.hm.shell.mkFishIntegrationOption { inherit config; };
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { inherit config; };
enableZshIntegration = lib.hm.shell.mkZshIntegrationOption { inherit config; };
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
programs = {
bash.initExtra = lib.mkIf cfg.enableBashIntegration ''
eval "$(${payRespectsCmd} bash ${cfgOptions})"
'';
zsh.initContent = lib.mkIf cfg.enableZshIntegration ''
eval "$(${payRespectsCmd} zsh ${cfgOptions})"
'';
fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration ''
${payRespectsCmd} fish ${cfgOptions} | source
'';
nushell.extraConfig = lib.mkIf cfg.enableNushellIntegration ''
source ${
pkgs.runCommand "pay-respects-nushell-config.nu" { } ''
${payRespectsCmd} nushell ${cfgOptions} >> "$out"
''
}
'';
};
};
}