nixos/television: init module (#397872)
This commit is contained in:
@@ -313,6 +313,7 @@
|
|||||||
./programs/system-config-printer.nix
|
./programs/system-config-printer.nix
|
||||||
./programs/systemtap.nix
|
./programs/systemtap.nix
|
||||||
./programs/tcpdump.nix
|
./programs/tcpdump.nix
|
||||||
|
./programs/television.nix
|
||||||
./programs/thefuck.nix
|
./programs/thefuck.nix
|
||||||
./programs/thunar.nix
|
./programs/thunar.nix
|
||||||
./programs/thunderbird.nix
|
./programs/thunderbird.nix
|
||||||
|
|||||||
42
nixos/modules/programs/television.nix
Normal file
42
nixos/modules/programs/television.nix
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib.options) mkEnableOption mkPackageOption;
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
|
||||||
|
cfg = config.programs.television;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.programs.television = {
|
||||||
|
enable = mkEnableOption "Blazingly fast general purpose fuzzy finder TUI";
|
||||||
|
package = mkPackageOption pkgs "television" { };
|
||||||
|
|
||||||
|
enableBashIntegration = mkEnableOption "Bash integration";
|
||||||
|
enableZshIntegration = mkEnableOption "Zsh integration";
|
||||||
|
enableFishIntegration = mkEnableOption "Fish integration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
zsh.interactiveShellInit = mkIf cfg.enableZshIntegration ''
|
||||||
|
eval "$(${getExe cfg.package} init zsh)"
|
||||||
|
'';
|
||||||
|
bash.interactiveShellInit = mkIf cfg.enableBashIntegration ''
|
||||||
|
eval "$(${getExe cfg.package} init bash)"
|
||||||
|
'';
|
||||||
|
fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
|
||||||
|
${getExe cfg.package} init fish | source
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = with lib.maintainers; [ pbek ];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user