Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

nixos/television: init module (#397872)

authored by

Thiago Kenji Okada and committed by
GitHub
1decace5 e5f26c0e

+43
+1
nixos/modules/module-list.nix
··· 313 313 ./programs/system-config-printer.nix 314 314 ./programs/systemtap.nix 315 315 ./programs/tcpdump.nix 316 + ./programs/television.nix 316 317 ./programs/thefuck.nix 317 318 ./programs/thunar.nix 318 319 ./programs/thunderbird.nix
+42
nixos/modules/programs/television.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + let 8 + inherit (lib.options) mkEnableOption mkPackageOption; 9 + inherit (lib.modules) mkIf; 10 + inherit (lib.meta) getExe; 11 + 12 + cfg = config.programs.television; 13 + in 14 + { 15 + options.programs.television = { 16 + enable = mkEnableOption "Blazingly fast general purpose fuzzy finder TUI"; 17 + package = mkPackageOption pkgs "television" { }; 18 + 19 + enableBashIntegration = mkEnableOption "Bash integration"; 20 + enableZshIntegration = mkEnableOption "Zsh integration"; 21 + enableFishIntegration = mkEnableOption "Fish integration"; 22 + }; 23 + 24 + config = mkIf cfg.enable { 25 + environment.systemPackages = [ cfg.package ]; 26 + 27 + programs = { 28 + zsh.interactiveShellInit = mkIf cfg.enableZshIntegration '' 29 + eval "$(${getExe cfg.package} init zsh)" 30 + ''; 31 + bash.interactiveShellInit = mkIf cfg.enableBashIntegration '' 32 + eval "$(${getExe cfg.package} init bash)" 33 + ''; 34 + fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' 35 + ${getExe cfg.package} init fish | source 36 + ''; 37 + }; 38 + 39 + }; 40 + 41 + meta.maintainers = with lib.maintainers; [ pbek ]; 42 + }