mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 21:25:30 +03:00
nixos/television: init module (#397872)
This commit is contained in:
commit
1decace5e9
2 changed files with 43 additions and 0 deletions
|
@ -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 ];
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue