2021-12-08 22:13:43 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.programs.fish.tide.nix-shell;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.programs.fish.tide.nix-shell = {
|
|
|
|
enable = mkEnableOption "An indicator of having a `nix shell` environment";
|
|
|
|
};
|
|
|
|
|
|
|
|
config.programs.fish = mkIf cfg.enable {
|
|
|
|
functions._tide_item_nix_shell = ''
|
2023-04-16 10:49:10 +00:00
|
|
|
# In a Nix Shell
|
2021-12-08 22:13:43 +00:00
|
|
|
if string match -q "/nix/store/*" $PATH
|
2023-04-16 10:49:10 +00:00
|
|
|
set -U tide_nix_shell_color (set -q DIRENV_DIR && echo "FFA500" || echo "blue")
|
2021-12-08 22:13:43 +00:00
|
|
|
set -U tide_nix_shell_bg_color normal
|
|
|
|
_tide_print_item nix_shell "❄"
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|