1.1--- a/Containerfile.box Fri Jan 26 20:54:26 2024 -0500
1.2+++ b/Containerfile.box Sat Jan 27 20:13:27 2024 -0500
1.3@@ -29,7 +29,6 @@
1.4 RUN make core-install
1.5 RUN cd .. && rm -rf infra core
1.6 ADD etc/skel/* /etc/skel/
1.7-ADD etc/nushell/* /etc/nushell/
1.8 ADD etc/shells /etc/
1.9 RUN useradd --system -s /usr/local/bin/nu -u ${ID} -k /etc/skel -m ${DEV}
1.10 RUN groupadd -g 128 engineer -U ${DEV}
1.11@@ -39,5 +38,5 @@
1.12 RUN hg clone https://vc.compiler.company/comp/infra
1.13 ENV DEV_USER=${DEV}
1.14 ENV DEV_ID=${ID}
1.15-ENTRYPOINT ["/usr/local/bin/nu", "--config", "/etc/nushell/config.nu", "--env-config", "/etc/nushell/env.nu"]
1.16+ENTRYPOINT ["/usr/local/bin/nu"]
1.17 CMD ["-i"]
2.1--- a/Containerfile.vc-runner Fri Jan 26 20:54:26 2024 -0500
2.2+++ b/Containerfile.vc-runner Sat Jan 27 20:13:27 2024 -0500
2.3@@ -1,4 +1,5 @@
2.4 FROM docker.io/octobus/heptapod-runner:latest
2.5+ARG RUNNER_TOKEN=0
2.6 VOLUME /stash
2.7 VOLUME /store
2.8-RUN gitlab-runner register
2.9\ No newline at end of file
2.10+RUN gitlab-runner register --non-interactive -u https://vc.compiler.company -t "${RUNNER_TOKEN}"
2.11\ No newline at end of file
3.1--- a/etc/nushell/config.nu Fri Jan 26 20:54:26 2024 -0500
3.2+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3@@ -1,595 +0,0 @@
3.4-# nushell/config.nu --- Nushell Config File
3.5-
3.6-# For more information on defining custom themes, see
3.7-# https://www.nushell.sh/book/coloring_and_theming.html
3.8-# And here is the theme collection
3.9-# https://github.com/nushell/nu_scripts/tree/main/themes
3.10-
3.11-def ec [input?: string] {
3.12- if $input != null {emacsclient -a='' $input} else {emacsclient -a='' .}
3.13-}
3.14-
3.15-def create_left_prompt [] {
3.16- mut home = ""
3.17- try {
3.18- if $nu.os-info.name == "windows" {
3.19- $home = $env.USERPROFILE
3.20- } else {
3.21- $home = $env.HOME
3.22- }
3.23- }
3.24-
3.25- let dir = ([
3.26- ($env.PWD | str substring 0..($home | str length) | str replace $home "~"),
3.27- ($env.PWD | str substring ($home | str length)..)
3.28- ] | str join)
3.29-
3.30- let path_color = (if (is-admin) { ansi red_bold } else { ansi green_bold })
3.31- let separator_color = (if (is-admin) { ansi light_red_bold } else { ansi light_green_bold })
3.32- let path_segment = $"($path_color)($dir)"
3.33-
3.34- $path_segment | str replace --all (char path_sep) $"($separator_color)/($path_color)"
3.35-}
3.36-
3.37-def create_right_prompt [] {
3.38- let time_segment_color = (ansi magenta)
3.39-
3.40- let time_segment = ([
3.41- (ansi reset)
3.42- $time_segment_color
3.43- (date now | format date '%m/%d/%Y %r')
3.44- ] | str join | str replace --all "([/:])" $"(ansi light_magenta_bold)${1}($time_segment_color)" |
3.45- str replace --all "([AP]M)" $"(ansi light_magenta_underline)${1}")
3.46-
3.47- let last_exit_code = if ($env.LAST_EXIT_CODE != 0) {([
3.48- (ansi rb)
3.49- ($env.LAST_EXIT_CODE)
3.50- ] | str join)
3.51- } else { "" }
3.52-
3.53- ([$last_exit_code, (char space), $time_segment] | str join)
3.54-}
3.55-
3.56-# Use nushell functions to define your right and left prompt
3.57-$env.PROMPT_COMMAND = {|| create_left_prompt }
3.58-$env.PROMPT_COMMAND_RIGHT = {|| create_right_prompt }
3.59-
3.60-# The prompt indicators are environmental variables that represent
3.61-# the state of the prompt
3.62-$env.PROMPT_INDICATOR = {|| "> " }
3.63-$env.PROMPT_INDICATOR_VI_INSERT = {|| ": " }
3.64-$env.PROMPT_INDICATOR_VI_NORMAL = {|| "> " }
3.65-$env.PROMPT_MULTILINE_INDICATOR = {|| "::: " }
3.66-
3.67-let dark_theme = {
3.68- # color for nushell primitives
3.69- separator: white
3.70- leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
3.71- header: green_bold
3.72- empty: blue
3.73- # Closures can be used to choose colors for specific values.
3.74- # The value (in this case, a bool) is piped into the closure.
3.75- bool: {|| if $in { 'light_cyan' } else { 'light_gray' } }
3.76- int: white
3.77- filesize: {|e|
3.78- if $e == 0b {
3.79- 'white'
3.80- } else if $e < 1mb {
3.81- 'cyan'
3.82- } else { 'blue' }
3.83- }
3.84- duration: white
3.85- date: {|| (date now) - $in |
3.86- if $in < 1hr {
3.87- 'purple'
3.88- } else if $in < 6hr {
3.89- 'red'
3.90- } else if $in < 1day {
3.91- 'yellow'
3.92- } else if $in < 3day {
3.93- 'green'
3.94- } else if $in < 1wk {
3.95- 'light_green'
3.96- } else if $in < 6wk {
3.97- 'cyan'
3.98- } else if $in < 52wk {
3.99- 'blue'
3.100- } else { 'dark_gray' }
3.101- }
3.102- range: white
3.103- float: white
3.104- string: white
3.105- nothing: white
3.106- binary: white
3.107- cellpath: white
3.108- row_index: green_bold
3.109- record: white
3.110- list: white
3.111- block: white
3.112- hints: dark_gray
3.113- search_result: {bg: red fg: white}
3.114-
3.115- shape_and: purple_bold
3.116- shape_binary: purple_bold
3.117- shape_block: blue_bold
3.118- shape_bool: light_cyan
3.119- shape_closure: green_bold
3.120- shape_custom: green
3.121- shape_datetime: cyan_bold
3.122- shape_directory: cyan
3.123- shape_external: cyan
3.124- shape_externalarg: green_bold
3.125- shape_filepath: cyan
3.126- shape_flag: blue_bold
3.127- shape_float: purple_bold
3.128- # shapes are used to change the cli syntax highlighting
3.129- shape_garbage: { fg: white bg: red attr: b}
3.130- shape_globpattern: cyan_bold
3.131- shape_int: purple_bold
3.132- shape_internalcall: cyan_bold
3.133- shape_list: cyan_bold
3.134- shape_literal: blue
3.135- shape_match_pattern: green
3.136- shape_matching_brackets: { attr: u }
3.137- shape_nothing: light_cyan
3.138- shape_operator: yellow
3.139- shape_or: purple_bold
3.140- shape_pipe: purple_bold
3.141- shape_range: yellow_bold
3.142- shape_record: cyan_bold
3.143- shape_redirection: purple_bold
3.144- shape_signature: green_bold
3.145- shape_string: green
3.146- shape_string_interpolation: cyan_bold
3.147- shape_table: blue_bold
3.148- shape_variable: purple
3.149- shape_vardecl: purple
3.150-}
3.151-
3.152-let light_theme = {
3.153- # color for nushell primitives
3.154- separator: dark_gray
3.155- leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
3.156- header: green_bold
3.157- empty: blue
3.158- # Closures can be used to choose colors for specific values.
3.159- # The value (in this case, a bool) is piped into the closure.
3.160- bool: {|| if $in { 'dark_cyan' } else { 'dark_gray' } }
3.161- int: dark_gray
3.162- filesize: {|e|
3.163- if $e == 0b {
3.164- 'dark_gray'
3.165- } else if $e < 1mb {
3.166- 'cyan_bold'
3.167- } else { 'blue_bold' }
3.168- }
3.169- duration: dark_gray
3.170- date: {|| (date now) - $in |
3.171- if $in < 1hr {
3.172- 'purple'
3.173- } else if $in < 6hr {
3.174- 'red'
3.175- } else if $in < 1day {
3.176- 'yellow'
3.177- } else if $in < 3day {
3.178- 'green'
3.179- } else if $in < 1wk {
3.180- 'light_green'
3.181- } else if $in < 6wk {
3.182- 'cyan'
3.183- } else if $in < 52wk {
3.184- 'blue'
3.185- } else { 'dark_gray' }
3.186- }
3.187- range: dark_gray
3.188- float: dark_gray
3.189- string: dark_gray
3.190- nothing: dark_gray
3.191- binary: dark_gray
3.192- cellpath: dark_gray
3.193- row_index: green_bold
3.194- record: white
3.195- list: white
3.196- block: white
3.197- hints: dark_gray
3.198- search_result: {fg: white bg: red}
3.199-
3.200- shape_and: purple_bold
3.201- shape_binary: purple_bold
3.202- shape_block: blue_bold
3.203- shape_bool: light_cyan
3.204- shape_closure: green_bold
3.205- shape_custom: green
3.206- shape_datetime: cyan_bold
3.207- shape_directory: cyan
3.208- shape_external: cyan
3.209- shape_externalarg: green_bold
3.210- shape_filepath: cyan
3.211- shape_flag: blue_bold
3.212- shape_float: purple_bold
3.213- # shapes are used to change the cli syntax highlighting
3.214- shape_garbage: { fg: white bg: red attr: b}
3.215- shape_globpattern: cyan_bold
3.216- shape_int: purple_bold
3.217- shape_internalcall: cyan_bold
3.218- shape_list: cyan_bold
3.219- shape_literal: blue
3.220- shape_match_pattern: green
3.221- shape_matching_brackets: { attr: u }
3.222- shape_nothing: light_cyan
3.223- shape_operator: yellow
3.224- shape_or: purple_bold
3.225- shape_pipe: purple_bold
3.226- shape_range: yellow_bold
3.227- shape_record: cyan_bold
3.228- shape_redirection: purple_bold
3.229- shape_signature: green_bold
3.230- shape_string: green
3.231- shape_string_interpolation: cyan_bold
3.232- shape_table: blue_bold
3.233- shape_variable: purple
3.234- shape_vardecl: purple
3.235-}
3.236-
3.237-# External completer example
3.238-# let carapace_completer = {|spans|
3.239-# carapace $spans.0 nushell $spans | from json
3.240-# }
3.241-
3.242-
3.243-# The default config record. This is where much of your global configuration is setup.
3.244-$env.config = {
3.245- # true or false to enable or disable the welcome banner at startup
3.246- show_banner: false
3.247- ls: {
3.248- use_ls_colors: true # use the LS_COLORS environment variable to colorize output
3.249- clickable_links: true # enable or disable clickable links. Your terminal has to support links.
3.250- }
3.251- rm: {
3.252- always_trash: false # always act as if -t was given. Can be overridden with -p
3.253- }
3.254- table: {
3.255- mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
3.256- index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
3.257- show_empty: true # show 'empty list' and 'empty record' placeholders for command output
3.258- trim: {
3.259- methodology: wrapping # wrapping or truncating
3.260- wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
3.261- truncating_suffix: "..." # A suffix used by the 'truncating' methodology
3.262- }
3.263- }
3.264-
3.265- explore: {
3.266- help_banner: true
3.267- exit_esc: true
3.268-
3.269- command_bar_text: '#C4C9C6'
3.270- # command_bar: {fg: '#C4C9C6' bg: '#223311' }
3.271-
3.272- status_bar_background: {fg: '#1D1F21' bg: '#C4C9C6' }
3.273- # status_bar_text: {fg: '#C4C9C6' bg: '#223311' }
3.274-
3.275- highlight: {bg: 'yellow' fg: 'black' }
3.276-
3.277- status: {
3.278- # warn: {bg: 'yellow', fg: 'blue'}
3.279- # error: {bg: 'yellow', fg: 'blue'}
3.280- # info: {bg: 'yellow', fg: 'blue'}
3.281- }
3.282-
3.283- try: {
3.284- # border_color: 'red'
3.285- # highlighted_color: 'blue'
3.286-
3.287- # reactive: false
3.288- }
3.289-
3.290- table: {
3.291- split_line: '#404040'
3.292-
3.293- cursor: true
3.294-
3.295- line_index: true
3.296- line_shift: true
3.297- line_head_top: true
3.298- line_head_bottom: true
3.299-
3.300- show_head: true
3.301- show_index: true
3.302-
3.303- # selected_cell: {fg: 'white', bg: '#777777'}
3.304- # selected_row: {fg: 'yellow', bg: '#C1C2A3'}
3.305- # selected_column: blue
3.306-
3.307- # padding_column_right: 2
3.308- # padding_column_left: 2
3.309-
3.310- # padding_index_left: 2
3.311- # padding_index_right: 1
3.312- }
3.313-
3.314- config: {
3.315- cursor_color: {bg: 'yellow' fg: 'black' }
3.316-
3.317- # border_color: white
3.318- # list_color: green
3.319- }
3.320- }
3.321-
3.322- history: {
3.323- max_size: 10000 # Session has to be reloaded for this to take effect
3.324- sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file
3.325- file_format: "plaintext" # "sqlite" or "plaintext"
3.326- }
3.327- completions: {
3.328- case_sensitive: false # set to true to enable case-sensitive completions
3.329- quick: true # set this to false to prevent auto-selecting completions when only one remains
3.330- partial: true # set this to false to prevent partial filling of the prompt
3.331- algorithm: "prefix" # prefix or fuzzy
3.332- external: {
3.333- enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow
3.334- max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
3.335- completer: null # check 'carapace_completer' above as an example
3.336- }
3.337- }
3.338- filesize: {
3.339- metric: true # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard)
3.340- format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, auto
3.341- }
3.342- cursor_shape: {
3.343- emacs: line # block, underscore, line, blink_block, blink_underscore, blink_line (line is the default)
3.344- vi_insert: block # block, underscore, line , blink_block, blink_underscore, blink_line (block is the default)
3.345- vi_normal: underscore # block, underscore, line, blink_block, blink_underscore, blink_line (underscore is the default)
3.346- }
3.347- color_config: $dark_theme # if you want a light theme, replace `$dark_theme` to `$light_theme`
3.348- use_grid_icons: true
3.349- footer_mode: "25" # always, never, number_of_rows, auto
3.350- float_precision: 2 # the precision for displaying floats in tables
3.351- # buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
3.352- use_ansi_coloring: true
3.353- bracketed_paste: true # enable bracketed paste, currently useless on windows
3.354- edit_mode: emacs # emacs, vi
3.355- shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue
3.356- render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
3.357-
3.358- hooks: {
3.359- pre_prompt: [{||
3.360- null # replace with source code to run before the prompt is shown
3.361- }]
3.362- pre_execution: [{||
3.363- null # replace with source code to run before the repl input is run
3.364- }]
3.365- env_change: {
3.366- PWD: [{|before, after|
3.367- null # replace with source code to run if the PWD environment is different since the last repl input
3.368- }]
3.369- }
3.370- display_output: {||
3.371- if (term size).columns >= 100 { table -e } else { table }
3.372- }
3.373- command_not_found: {||
3.374- null # replace with source code to return an error message when a command is not found
3.375- }
3.376- }
3.377- menus: [
3.378- # Configuration for default nushell menus
3.379- # Note the lack of source parameter
3.380- {
3.381- name: completion_menu
3.382- only_buffer_difference: false
3.383- marker: "| "
3.384- type: {
3.385- layout: columnar
3.386- columns: 4
3.387- col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
3.388- col_padding: 2
3.389- }
3.390- style: {
3.391- text: green
3.392- selected_text: green_reverse
3.393- description_text: yellow
3.394- }
3.395- }
3.396- {
3.397- name: history_menu
3.398- only_buffer_difference: true
3.399- marker: "? "
3.400- type: {
3.401- layout: list
3.402- page_size: 10
3.403- }
3.404- style: {
3.405- text: green
3.406- selected_text: green_reverse
3.407- description_text: yellow
3.408- }
3.409- }
3.410- {
3.411- name: help_menu
3.412- only_buffer_difference: true
3.413- marker: "? "
3.414- type: {
3.415- layout: description
3.416- columns: 4
3.417- col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
3.418- col_padding: 2
3.419- selection_rows: 4
3.420- description_rows: 10
3.421- }
3.422- style: {
3.423- text: green
3.424- selected_text: green_reverse
3.425- description_text: yellow
3.426- }
3.427- }
3.428- # Example of extra menus created using a nushell source
3.429- # Use the source field to create a list of records that populates
3.430- # the menu
3.431- {
3.432- name: commands_menu
3.433- only_buffer_difference: false
3.434- marker: "# "
3.435- type: {
3.436- layout: columnar
3.437- columns: 4
3.438- col_width: 20
3.439- col_padding: 2
3.440- }
3.441- style: {
3.442- text: green
3.443- selected_text: green_reverse
3.444- description_text: yellow
3.445- }
3.446- source: { |buffer, position|
3.447- $nu.scope.commands
3.448- | where name =~ $buffer
3.449- | each { |it| {value: $it.name description: $it.usage} }
3.450- }
3.451- }
3.452- {
3.453- name: vars_menu
3.454- only_buffer_difference: true
3.455- marker: "# "
3.456- type: {
3.457- layout: list
3.458- page_size: 10
3.459- }
3.460- style: {
3.461- text: green
3.462- selected_text: green_reverse
3.463- description_text: yellow
3.464- }
3.465- source: { |buffer, position|
3.466- $nu.scope.vars
3.467- | where name =~ $buffer
3.468- | sort-by name
3.469- | each { |it| {value: $it.name description: $it.type} }
3.470- }
3.471- }
3.472- {
3.473- name: commands_with_description
3.474- only_buffer_difference: true
3.475- marker: "# "
3.476- type: {
3.477- layout: description
3.478- columns: 4
3.479- col_width: 20
3.480- col_padding: 2
3.481- selection_rows: 4
3.482- description_rows: 10
3.483- }
3.484- style: {
3.485- text: green
3.486- selected_text: green_reverse
3.487- description_text: yellow
3.488- }
3.489- source: { |buffer, position|
3.490- $nu.scope.commands
3.491- | where name =~ $buffer
3.492- | each { |it| {value: $it.name description: $it.usage} }
3.493- }
3.494- }
3.495- ]
3.496- keybindings: [
3.497- {
3.498- name: completion_menu
3.499- modifier: none
3.500- keycode: tab
3.501- mode: [emacs vi_normal vi_insert]
3.502- event: {
3.503- until: [
3.504- { send: menu name: completion_menu }
3.505- { send: menunext }
3.506- ]
3.507- }
3.508- }
3.509- {
3.510- name: completion_previous
3.511- modifier: shift
3.512- keycode: backtab
3.513- mode: [emacs, vi_normal, vi_insert] # Note: You can add the same keybinding to all modes by using a list
3.514- event: { send: menuprevious }
3.515- }
3.516- {
3.517- name: history_menu
3.518- modifier: control
3.519- keycode: char_r
3.520- mode: emacs
3.521- event: { send: menu name: history_menu }
3.522- }
3.523- {
3.524- name: next_page
3.525- modifier: control
3.526- keycode: char_x
3.527- mode: emacs
3.528- event: { send: menupagenext }
3.529- }
3.530- {
3.531- name: undo_or_previous_page
3.532- modifier: control
3.533- keycode: char_z
3.534- mode: emacs
3.535- event: {
3.536- until: [
3.537- { send: menupageprevious }
3.538- { edit: undo }
3.539- ]
3.540- }
3.541- }
3.542- {
3.543- name: yank
3.544- modifier: control
3.545- keycode: char_y
3.546- mode: emacs
3.547- event: {
3.548- until: [
3.549- {edit: pastecutbufferafter}
3.550- ]
3.551- }
3.552- }
3.553- {
3.554- name: unix-line-discard
3.555- modifier: control
3.556- keycode: char_u
3.557- mode: [emacs, vi_normal, vi_insert]
3.558- event: {
3.559- until: [
3.560- {edit: cutfromlinestart}
3.561- ]
3.562- }
3.563- }
3.564- {
3.565- name: kill-line
3.566- modifier: control
3.567- keycode: char_k
3.568- mode: [emacs, vi_normal, vi_insert]
3.569- event: {
3.570- until: [
3.571- {edit: cuttolineend}
3.572- ]
3.573- }
3.574- }
3.575- # Keybindings used to trigger the user defined menus
3.576- {
3.577- name: commands_menu
3.578- modifier: control
3.579- keycode: char_t
3.580- mode: [emacs, vi_normal, vi_insert]
3.581- event: { send: menu name: commands_menu }
3.582- }
3.583- {
3.584- name: vars_menu
3.585- modifier: alt
3.586- keycode: char_o
3.587- mode: [emacs, vi_normal, vi_insert]
3.588- event: { send: menu name: vars_menu }
3.589- }
3.590- {
3.591- name: commands_with_description
3.592- modifier: control
3.593- keycode: char_s
3.594- mode: [emacs, vi_normal, vi_insert]
3.595- event: { send: menu name: commands_with_description }
3.596- }
3.597- ]
3.598-}
4.1--- a/etc/nushell/env.nu Fri Jan 26 20:54:26 2024 -0500
4.2+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3@@ -1,13 +0,0 @@
4.4-# nushell/env.nu
4.5-
4.6-$env.NU_LIB_DIRS = [
4.7- ($nu.default-config-dir | path join 'scripts')
4.8-]
4.9-
4.10-$env.NU_PLUGIN_DIRS = [
4.11- ($nu.default-config-dir | path join 'plugins')
4.12-]
4.13-
4.14-$env.ESHELL = '/bin/bash'
4.15-$env.ORGANIZATION = 'The Compiler Company'
4.16-$env.EDITOR = "emacsclient -c -a=''"
4.17\ No newline at end of file
5.1--- a/etc/skel/.bash_logout Fri Jan 26 20:54:26 2024 -0500
5.2+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3@@ -1,3 +0,0 @@
5.4-#
5.5-# ~/.bash_logout
5.6-#
6.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2+++ b/etc/skel/.config/nushell/config.nu Sat Jan 27 20:13:27 2024 -0500
6.3@@ -0,0 +1,595 @@
6.4+# nushell/config.nu --- Nushell Config File
6.5+
6.6+# For more information on defining custom themes, see
6.7+# https://www.nushell.sh/book/coloring_and_theming.html
6.8+# And here is the theme collection
6.9+# https://github.com/nushell/nu_scripts/tree/main/themes
6.10+
6.11+def ec [input?: string] {
6.12+ if $input != null {emacsclient -a='' $input} else {emacsclient -a='' .}
6.13+}
6.14+
6.15+def create_left_prompt [] {
6.16+ mut home = ""
6.17+ try {
6.18+ if $nu.os-info.name == "windows" {
6.19+ $home = $env.USERPROFILE
6.20+ } else {
6.21+ $home = $env.HOME
6.22+ }
6.23+ }
6.24+
6.25+ let dir = ([
6.26+ ($env.PWD | str substring 0..($home | str length) | str replace $home "~"),
6.27+ ($env.PWD | str substring ($home | str length)..)
6.28+ ] | str join)
6.29+
6.30+ let path_color = (if (is-admin) { ansi red_bold } else { ansi green_bold })
6.31+ let separator_color = (if (is-admin) { ansi light_red_bold } else { ansi light_green_bold })
6.32+ let path_segment = $"($path_color)($dir)"
6.33+
6.34+ $path_segment | str replace --all (char path_sep) $"($separator_color)/($path_color)"
6.35+}
6.36+
6.37+def create_right_prompt [] {
6.38+ let time_segment_color = (ansi magenta)
6.39+
6.40+ let time_segment = ([
6.41+ (ansi reset)
6.42+ $time_segment_color
6.43+ (date now | format date '%m/%d/%Y %r')
6.44+ ] | str join | str replace --all "([/:])" $"(ansi light_magenta_bold)${1}($time_segment_color)" |
6.45+ str replace --all "([AP]M)" $"(ansi light_magenta_underline)${1}")
6.46+
6.47+ let last_exit_code = if ($env.LAST_EXIT_CODE != 0) {([
6.48+ (ansi rb)
6.49+ ($env.LAST_EXIT_CODE)
6.50+ ] | str join)
6.51+ } else { "" }
6.52+
6.53+ ([$last_exit_code, (char space), $time_segment] | str join)
6.54+}
6.55+
6.56+# Use nushell functions to define your right and left prompt
6.57+$env.PROMPT_COMMAND = {|| create_left_prompt }
6.58+$env.PROMPT_COMMAND_RIGHT = {|| create_right_prompt }
6.59+
6.60+# The prompt indicators are environmental variables that represent
6.61+# the state of the prompt
6.62+$env.PROMPT_INDICATOR = {|| "> " }
6.63+$env.PROMPT_INDICATOR_VI_INSERT = {|| ": " }
6.64+$env.PROMPT_INDICATOR_VI_NORMAL = {|| "> " }
6.65+$env.PROMPT_MULTILINE_INDICATOR = {|| "::: " }
6.66+
6.67+let dark_theme = {
6.68+ # color for nushell primitives
6.69+ separator: white
6.70+ leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
6.71+ header: green_bold
6.72+ empty: blue
6.73+ # Closures can be used to choose colors for specific values.
6.74+ # The value (in this case, a bool) is piped into the closure.
6.75+ bool: {|| if $in { 'light_cyan' } else { 'light_gray' } }
6.76+ int: white
6.77+ filesize: {|e|
6.78+ if $e == 0b {
6.79+ 'white'
6.80+ } else if $e < 1mb {
6.81+ 'cyan'
6.82+ } else { 'blue' }
6.83+ }
6.84+ duration: white
6.85+ date: {|| (date now) - $in |
6.86+ if $in < 1hr {
6.87+ 'purple'
6.88+ } else if $in < 6hr {
6.89+ 'red'
6.90+ } else if $in < 1day {
6.91+ 'yellow'
6.92+ } else if $in < 3day {
6.93+ 'green'
6.94+ } else if $in < 1wk {
6.95+ 'light_green'
6.96+ } else if $in < 6wk {
6.97+ 'cyan'
6.98+ } else if $in < 52wk {
6.99+ 'blue'
6.100+ } else { 'dark_gray' }
6.101+ }
6.102+ range: white
6.103+ float: white
6.104+ string: white
6.105+ nothing: white
6.106+ binary: white
6.107+ cellpath: white
6.108+ row_index: green_bold
6.109+ record: white
6.110+ list: white
6.111+ block: white
6.112+ hints: dark_gray
6.113+ search_result: {bg: red fg: white}
6.114+
6.115+ shape_and: purple_bold
6.116+ shape_binary: purple_bold
6.117+ shape_block: blue_bold
6.118+ shape_bool: light_cyan
6.119+ shape_closure: green_bold
6.120+ shape_custom: green
6.121+ shape_datetime: cyan_bold
6.122+ shape_directory: cyan
6.123+ shape_external: cyan
6.124+ shape_externalarg: green_bold
6.125+ shape_filepath: cyan
6.126+ shape_flag: blue_bold
6.127+ shape_float: purple_bold
6.128+ # shapes are used to change the cli syntax highlighting
6.129+ shape_garbage: { fg: white bg: red attr: b}
6.130+ shape_globpattern: cyan_bold
6.131+ shape_int: purple_bold
6.132+ shape_internalcall: cyan_bold
6.133+ shape_list: cyan_bold
6.134+ shape_literal: blue
6.135+ shape_match_pattern: green
6.136+ shape_matching_brackets: { attr: u }
6.137+ shape_nothing: light_cyan
6.138+ shape_operator: yellow
6.139+ shape_or: purple_bold
6.140+ shape_pipe: purple_bold
6.141+ shape_range: yellow_bold
6.142+ shape_record: cyan_bold
6.143+ shape_redirection: purple_bold
6.144+ shape_signature: green_bold
6.145+ shape_string: green
6.146+ shape_string_interpolation: cyan_bold
6.147+ shape_table: blue_bold
6.148+ shape_variable: purple
6.149+ shape_vardecl: purple
6.150+}
6.151+
6.152+let light_theme = {
6.153+ # color for nushell primitives
6.154+ separator: dark_gray
6.155+ leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
6.156+ header: green_bold
6.157+ empty: blue
6.158+ # Closures can be used to choose colors for specific values.
6.159+ # The value (in this case, a bool) is piped into the closure.
6.160+ bool: {|| if $in { 'dark_cyan' } else { 'dark_gray' } }
6.161+ int: dark_gray
6.162+ filesize: {|e|
6.163+ if $e == 0b {
6.164+ 'dark_gray'
6.165+ } else if $e < 1mb {
6.166+ 'cyan_bold'
6.167+ } else { 'blue_bold' }
6.168+ }
6.169+ duration: dark_gray
6.170+ date: {|| (date now) - $in |
6.171+ if $in < 1hr {
6.172+ 'purple'
6.173+ } else if $in < 6hr {
6.174+ 'red'
6.175+ } else if $in < 1day {
6.176+ 'yellow'
6.177+ } else if $in < 3day {
6.178+ 'green'
6.179+ } else if $in < 1wk {
6.180+ 'light_green'
6.181+ } else if $in < 6wk {
6.182+ 'cyan'
6.183+ } else if $in < 52wk {
6.184+ 'blue'
6.185+ } else { 'dark_gray' }
6.186+ }
6.187+ range: dark_gray
6.188+ float: dark_gray
6.189+ string: dark_gray
6.190+ nothing: dark_gray
6.191+ binary: dark_gray
6.192+ cellpath: dark_gray
6.193+ row_index: green_bold
6.194+ record: white
6.195+ list: white
6.196+ block: white
6.197+ hints: dark_gray
6.198+ search_result: {fg: white bg: red}
6.199+
6.200+ shape_and: purple_bold
6.201+ shape_binary: purple_bold
6.202+ shape_block: blue_bold
6.203+ shape_bool: light_cyan
6.204+ shape_closure: green_bold
6.205+ shape_custom: green
6.206+ shape_datetime: cyan_bold
6.207+ shape_directory: cyan
6.208+ shape_external: cyan
6.209+ shape_externalarg: green_bold
6.210+ shape_filepath: cyan
6.211+ shape_flag: blue_bold
6.212+ shape_float: purple_bold
6.213+ # shapes are used to change the cli syntax highlighting
6.214+ shape_garbage: { fg: white bg: red attr: b}
6.215+ shape_globpattern: cyan_bold
6.216+ shape_int: purple_bold
6.217+ shape_internalcall: cyan_bold
6.218+ shape_list: cyan_bold
6.219+ shape_literal: blue
6.220+ shape_match_pattern: green
6.221+ shape_matching_brackets: { attr: u }
6.222+ shape_nothing: light_cyan
6.223+ shape_operator: yellow
6.224+ shape_or: purple_bold
6.225+ shape_pipe: purple_bold
6.226+ shape_range: yellow_bold
6.227+ shape_record: cyan_bold
6.228+ shape_redirection: purple_bold
6.229+ shape_signature: green_bold
6.230+ shape_string: green
6.231+ shape_string_interpolation: cyan_bold
6.232+ shape_table: blue_bold
6.233+ shape_variable: purple
6.234+ shape_vardecl: purple
6.235+}
6.236+
6.237+# External completer example
6.238+# let carapace_completer = {|spans|
6.239+# carapace $spans.0 nushell $spans | from json
6.240+# }
6.241+
6.242+
6.243+# The default config record. This is where much of your global configuration is setup.
6.244+$env.config = {
6.245+ # true or false to enable or disable the welcome banner at startup
6.246+ show_banner: false
6.247+ ls: {
6.248+ use_ls_colors: true # use the LS_COLORS environment variable to colorize output
6.249+ clickable_links: true # enable or disable clickable links. Your terminal has to support links.
6.250+ }
6.251+ rm: {
6.252+ always_trash: false # always act as if -t was given. Can be overridden with -p
6.253+ }
6.254+ table: {
6.255+ mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
6.256+ index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
6.257+ show_empty: true # show 'empty list' and 'empty record' placeholders for command output
6.258+ trim: {
6.259+ methodology: wrapping # wrapping or truncating
6.260+ wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
6.261+ truncating_suffix: "..." # A suffix used by the 'truncating' methodology
6.262+ }
6.263+ }
6.264+
6.265+ explore: {
6.266+ help_banner: true
6.267+ exit_esc: true
6.268+
6.269+ command_bar_text: '#C4C9C6'
6.270+ # command_bar: {fg: '#C4C9C6' bg: '#223311' }
6.271+
6.272+ status_bar_background: {fg: '#1D1F21' bg: '#C4C9C6' }
6.273+ # status_bar_text: {fg: '#C4C9C6' bg: '#223311' }
6.274+
6.275+ highlight: {bg: 'yellow' fg: 'black' }
6.276+
6.277+ status: {
6.278+ # warn: {bg: 'yellow', fg: 'blue'}
6.279+ # error: {bg: 'yellow', fg: 'blue'}
6.280+ # info: {bg: 'yellow', fg: 'blue'}
6.281+ }
6.282+
6.283+ try: {
6.284+ # border_color: 'red'
6.285+ # highlighted_color: 'blue'
6.286+
6.287+ # reactive: false
6.288+ }
6.289+
6.290+ table: {
6.291+ split_line: '#404040'
6.292+
6.293+ cursor: true
6.294+
6.295+ line_index: true
6.296+ line_shift: true
6.297+ line_head_top: true
6.298+ line_head_bottom: true
6.299+
6.300+ show_head: true
6.301+ show_index: true
6.302+
6.303+ # selected_cell: {fg: 'white', bg: '#777777'}
6.304+ # selected_row: {fg: 'yellow', bg: '#C1C2A3'}
6.305+ # selected_column: blue
6.306+
6.307+ # padding_column_right: 2
6.308+ # padding_column_left: 2
6.309+
6.310+ # padding_index_left: 2
6.311+ # padding_index_right: 1
6.312+ }
6.313+
6.314+ config: {
6.315+ cursor_color: {bg: 'yellow' fg: 'black' }
6.316+
6.317+ # border_color: white
6.318+ # list_color: green
6.319+ }
6.320+ }
6.321+
6.322+ history: {
6.323+ max_size: 10000 # Session has to be reloaded for this to take effect
6.324+ sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file
6.325+ file_format: "plaintext" # "sqlite" or "plaintext"
6.326+ }
6.327+ completions: {
6.328+ case_sensitive: false # set to true to enable case-sensitive completions
6.329+ quick: true # set this to false to prevent auto-selecting completions when only one remains
6.330+ partial: true # set this to false to prevent partial filling of the prompt
6.331+ algorithm: "prefix" # prefix or fuzzy
6.332+ external: {
6.333+ enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow
6.334+ max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
6.335+ completer: null # check 'carapace_completer' above as an example
6.336+ }
6.337+ }
6.338+ filesize: {
6.339+ metric: true # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard)
6.340+ format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, auto
6.341+ }
6.342+ cursor_shape: {
6.343+ emacs: line # block, underscore, line, blink_block, blink_underscore, blink_line (line is the default)
6.344+ vi_insert: block # block, underscore, line , blink_block, blink_underscore, blink_line (block is the default)
6.345+ vi_normal: underscore # block, underscore, line, blink_block, blink_underscore, blink_line (underscore is the default)
6.346+ }
6.347+ color_config: $dark_theme # if you want a light theme, replace `$dark_theme` to `$light_theme`
6.348+ use_grid_icons: true
6.349+ footer_mode: "25" # always, never, number_of_rows, auto
6.350+ float_precision: 2 # the precision for displaying floats in tables
6.351+ # buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
6.352+ use_ansi_coloring: true
6.353+ bracketed_paste: true # enable bracketed paste, currently useless on windows
6.354+ edit_mode: emacs # emacs, vi
6.355+ shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue
6.356+ render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
6.357+
6.358+ hooks: {
6.359+ pre_prompt: [{||
6.360+ null # replace with source code to run before the prompt is shown
6.361+ }]
6.362+ pre_execution: [{||
6.363+ null # replace with source code to run before the repl input is run
6.364+ }]
6.365+ env_change: {
6.366+ PWD: [{|before, after|
6.367+ null # replace with source code to run if the PWD environment is different since the last repl input
6.368+ }]
6.369+ }
6.370+ display_output: {||
6.371+ if (term size).columns >= 100 { table -e } else { table }
6.372+ }
6.373+ command_not_found: {||
6.374+ null # replace with source code to return an error message when a command is not found
6.375+ }
6.376+ }
6.377+ menus: [
6.378+ # Configuration for default nushell menus
6.379+ # Note the lack of source parameter
6.380+ {
6.381+ name: completion_menu
6.382+ only_buffer_difference: false
6.383+ marker: "| "
6.384+ type: {
6.385+ layout: columnar
6.386+ columns: 4
6.387+ col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
6.388+ col_padding: 2
6.389+ }
6.390+ style: {
6.391+ text: green
6.392+ selected_text: green_reverse
6.393+ description_text: yellow
6.394+ }
6.395+ }
6.396+ {
6.397+ name: history_menu
6.398+ only_buffer_difference: true
6.399+ marker: "? "
6.400+ type: {
6.401+ layout: list
6.402+ page_size: 10
6.403+ }
6.404+ style: {
6.405+ text: green
6.406+ selected_text: green_reverse
6.407+ description_text: yellow
6.408+ }
6.409+ }
6.410+ {
6.411+ name: help_menu
6.412+ only_buffer_difference: true
6.413+ marker: "? "
6.414+ type: {
6.415+ layout: description
6.416+ columns: 4
6.417+ col_width: 20 # Optional value. If missing all the screen width is used to calculate column width
6.418+ col_padding: 2
6.419+ selection_rows: 4
6.420+ description_rows: 10
6.421+ }
6.422+ style: {
6.423+ text: green
6.424+ selected_text: green_reverse
6.425+ description_text: yellow
6.426+ }
6.427+ }
6.428+ # Example of extra menus created using a nushell source
6.429+ # Use the source field to create a list of records that populates
6.430+ # the menu
6.431+ {
6.432+ name: commands_menu
6.433+ only_buffer_difference: false
6.434+ marker: "# "
6.435+ type: {
6.436+ layout: columnar
6.437+ columns: 4
6.438+ col_width: 20
6.439+ col_padding: 2
6.440+ }
6.441+ style: {
6.442+ text: green
6.443+ selected_text: green_reverse
6.444+ description_text: yellow
6.445+ }
6.446+ source: { |buffer, position|
6.447+ $nu.scope.commands
6.448+ | where name =~ $buffer
6.449+ | each { |it| {value: $it.name description: $it.usage} }
6.450+ }
6.451+ }
6.452+ {
6.453+ name: vars_menu
6.454+ only_buffer_difference: true
6.455+ marker: "# "
6.456+ type: {
6.457+ layout: list
6.458+ page_size: 10
6.459+ }
6.460+ style: {
6.461+ text: green
6.462+ selected_text: green_reverse
6.463+ description_text: yellow
6.464+ }
6.465+ source: { |buffer, position|
6.466+ $nu.scope.vars
6.467+ | where name =~ $buffer
6.468+ | sort-by name
6.469+ | each { |it| {value: $it.name description: $it.type} }
6.470+ }
6.471+ }
6.472+ {
6.473+ name: commands_with_description
6.474+ only_buffer_difference: true
6.475+ marker: "# "
6.476+ type: {
6.477+ layout: description
6.478+ columns: 4
6.479+ col_width: 20
6.480+ col_padding: 2
6.481+ selection_rows: 4
6.482+ description_rows: 10
6.483+ }
6.484+ style: {
6.485+ text: green
6.486+ selected_text: green_reverse
6.487+ description_text: yellow
6.488+ }
6.489+ source: { |buffer, position|
6.490+ $nu.scope.commands
6.491+ | where name =~ $buffer
6.492+ | each { |it| {value: $it.name description: $it.usage} }
6.493+ }
6.494+ }
6.495+ ]
6.496+ keybindings: [
6.497+ {
6.498+ name: completion_menu
6.499+ modifier: none
6.500+ keycode: tab
6.501+ mode: [emacs vi_normal vi_insert]
6.502+ event: {
6.503+ until: [
6.504+ { send: menu name: completion_menu }
6.505+ { send: menunext }
6.506+ ]
6.507+ }
6.508+ }
6.509+ {
6.510+ name: completion_previous
6.511+ modifier: shift
6.512+ keycode: backtab
6.513+ mode: [emacs, vi_normal, vi_insert] # Note: You can add the same keybinding to all modes by using a list
6.514+ event: { send: menuprevious }
6.515+ }
6.516+ {
6.517+ name: history_menu
6.518+ modifier: control
6.519+ keycode: char_r
6.520+ mode: emacs
6.521+ event: { send: menu name: history_menu }
6.522+ }
6.523+ {
6.524+ name: next_page
6.525+ modifier: control
6.526+ keycode: char_x
6.527+ mode: emacs
6.528+ event: { send: menupagenext }
6.529+ }
6.530+ {
6.531+ name: undo_or_previous_page
6.532+ modifier: control
6.533+ keycode: char_z
6.534+ mode: emacs
6.535+ event: {
6.536+ until: [
6.537+ { send: menupageprevious }
6.538+ { edit: undo }
6.539+ ]
6.540+ }
6.541+ }
6.542+ {
6.543+ name: yank
6.544+ modifier: control
6.545+ keycode: char_y
6.546+ mode: emacs
6.547+ event: {
6.548+ until: [
6.549+ {edit: pastecutbufferafter}
6.550+ ]
6.551+ }
6.552+ }
6.553+ {
6.554+ name: unix-line-discard
6.555+ modifier: control
6.556+ keycode: char_u
6.557+ mode: [emacs, vi_normal, vi_insert]
6.558+ event: {
6.559+ until: [
6.560+ {edit: cutfromlinestart}
6.561+ ]
6.562+ }
6.563+ }
6.564+ {
6.565+ name: kill-line
6.566+ modifier: control
6.567+ keycode: char_k
6.568+ mode: [emacs, vi_normal, vi_insert]
6.569+ event: {
6.570+ until: [
6.571+ {edit: cuttolineend}
6.572+ ]
6.573+ }
6.574+ }
6.575+ # Keybindings used to trigger the user defined menus
6.576+ {
6.577+ name: commands_menu
6.578+ modifier: control
6.579+ keycode: char_t
6.580+ mode: [emacs, vi_normal, vi_insert]
6.581+ event: { send: menu name: commands_menu }
6.582+ }
6.583+ {
6.584+ name: vars_menu
6.585+ modifier: alt
6.586+ keycode: char_o
6.587+ mode: [emacs, vi_normal, vi_insert]
6.588+ event: { send: menu name: vars_menu }
6.589+ }
6.590+ {
6.591+ name: commands_with_description
6.592+ modifier: control
6.593+ keycode: char_s
6.594+ mode: [emacs, vi_normal, vi_insert]
6.595+ event: { send: menu name: commands_with_description }
6.596+ }
6.597+ ]
6.598+}
7.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2+++ b/etc/skel/.config/nushell/env.nu Sat Jan 27 20:13:27 2024 -0500
7.3@@ -0,0 +1,15 @@
7.4+# nushell/env.nu
7.5+
7.6+$env.NU_LIB_DIRS = [
7.7+ ($nu.default-config-dir | path join 'scripts')
7.8+]
7.9+
7.10+$env.NU_PLUGIN_DIRS = [
7.11+ ($nu.default-config-dir | path join 'plugins')
7.12+]
7.13+
7.14+$env.ESHELL = '/bin/bash'
7.15+$env.ORGANIZATION = 'The Compiler Company'
7.16+$env.EDITOR = "emacsclient -c -a=''"
7.17+$env.LISP = "sbcl"
7.18+$env.ALTERNATE_EDITOR = ''
8.1--- a/etc/skel/.skelrc Fri Jan 26 20:54:26 2024 -0500
8.2+++ b/etc/skel/.skelrc Sat Jan 27 20:13:27 2024 -0500
8.3@@ -0,0 +1,6 @@
8.4+;;; .skelrc @ 2024-01-28.00:39:30 -*- mode:skel; -*-
8.5+:vc :hg
8.6+:fmt :collapsed
8.7+:tags ("auto")
8.8+:auto-insert t
8.9+:log-level nil
8.10\ No newline at end of file