diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 4949b757f..bbbe1a047 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1207,6 +1207,13 @@ in A new module is available: 'programs.rtorrent'. ''; } + + { + time = "2019-11-04T20:56:29+00:00"; + message = '' + A new module is available: 'programs.pazi'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 2dc89ebc0..340f0be33 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -82,6 +82,7 @@ let (loadModule ./programs/obs-studio.nix { }) (loadModule ./programs/offlineimap.nix { }) (loadModule ./programs/opam.nix { }) + (loadModule ./programs/pazi.nix { }) (loadModule ./programs/pidgin.nix { }) (loadModule ./programs/rofi.nix { }) (loadModule ./programs/rtorrent.nix { }) diff --git a/modules/programs/pazi.nix b/modules/programs/pazi.nix new file mode 100644 index 000000000..decc0d9db --- /dev/null +++ b/modules/programs/pazi.nix @@ -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 + ''; + }; +}