This commit is contained in:
Jeffrey C. Ollie 2023-03-07 21:46:35 -06:00
commit e7a00dcc0e
No known key found for this signature in database
GPG Key ID: F936E4DCB7E25F15
1 changed files with 32 additions and 0 deletions

32
flake.nix Normal file
View File

@ -0,0 +1,32 @@
{
description = "Bash Prompt Builder";
inputs = { };
outputs = { self, ... }@inputs: {
ESC = "\\033";
CSI = "${self.ESC}[";
OSC = "${self.ESC}]";
BEL = "\\007";
nonprinting_begin = "\\[";
nonprinting_end = "\\]";
wrap_nonprinting = text: "${self.nonprinting_begin}${text}${self.nonprinting_end}";
prompt = "\\$";
current_working_directory = "\\w";
username = "\\u";
hostname_short = "\\h";
hostname_long = "\\H";
ansi_reset = self.wrap_nonprinting "${self.CSI}0m";
ansi_color = style: color: self.wrap_nonprinting "${self.CSI}${builtins.toString style};${builtins.toString color}m";
ansi_style_normal = 1;
ansi_normal_color = color: self.ansi_color self.ansi_style_normal color;
ansi_normal_blue = self.ansi_normal_color 34;
title_bar = title: self.wrap_nonprinting "${self.OSC}0;${title}${self.BEL}";
build_prompt = color: title_bar_text: prompt_text: "${color}[${self.title_bar title_bar_text}${prompt_text}]${self.prompt}${self.ansi_reset} ";
};
}