flox format

This commit is contained in:
death916 2025-05-30 04:54:27 -07:00
parent 2bd2ca7619
commit a28f02c767

View file

@ -1,3 +1,4 @@
# ~/Documents/nix-config/home-manager/home.nix
{ config, pkgs, lib, hmLib, ... }:
let
@ -99,13 +100,21 @@ in
disabled = false;
};
env_var.current_user_display = {
variable = "USER";
format = "[USER: $env_value] ";
disabled = false;
custom.flox_indicator = {
description = "Indicates active Flox environment";
# This command will ONLY run if 'when' is true.
# It outputs the desired string with a trailing space.
# echo -n prevents adding a newline character at the end of the string.
command = ''echo -n "via $FLOX_PROMPT_ENVIRONMENTS "'';
# The 'when' clause is the primary controller.
# If this shell command returns a non-zero exit code (false),
# the module (command and format) is skipped.
when = ''test -n "$FLOX_PROMPT_ENVIRONMENTS"'';
format = "$output"; # Takes the output of the command.
shell = ["bash" "-c"];
};
format = ''$directory $git_branch $conda$env_var_current_user_display$nix_shell$cmd_duration$status$character'';
format = ''$directory $git_branch $conda$custom.flox_indicator$nix_shell$cmd_duration$status$character'';
};
};