pazi: add module

This commit is contained in:
Mario Rodas 2019-11-03 16:20:00 -05:00 committed by Robert Helgesson
parent 49852220f9
commit 05dabb7239
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 65 additions and 0 deletions

57
modules/programs/pazi.nix Normal file
View file

@ -0,0 +1,57 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.pazi;
in
{
meta.maintainers = [ maintainers.marsam ];
options.programs.pazi = {
enable = mkEnableOption "pazi";
enableBashIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Bash integration.
'';
};
enableZshIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Zsh integration.
'';
};
enableFishIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Fish integration.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.pazi ];
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
eval "$(${pkgs.pazi}/bin/pazi init bash)"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
eval "$(${pkgs.pazi}/bin/pazi init zsh)"
'';
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
${pkgs.pazi}/bin/pazi init fish | source
'';
};
}