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Z4KRNZTKWROH5J36S43CQBHEBQC QEYE6IEG73H4YBRUA3QGQK5NOPWW4YYK2R4NHAUY65ST6WSZNKGAC A4CEWKDCNUJRE2PNF6NVZOZOF45Q3DVQWHLJCDRWJRGC6STSUY4QC MGQ2LOGX65YZT7TCVN6EWWAEVW34FJU65YXYX6D2SNNWYEC54MDQC 53PYAPOTQSDXGBCFGUU4JUUCOOPPEMH7QXFJDGJ54PJAVP66P65AC AYC5XZZHHZTH6N5S4UQETX522LI7GHFRP7TVU3SNFPESLX2Q4HLQC MBMEGIUAQV6INNHFZFMB4YFU7X6FQJR7ABOVZKAOFJ7I6NQEILTQC S5BW44UR2KEVGESVWPA4GVOX5REGJ2SNR3XJKYX66WHSNM7A4HAAC {config.flake.modules.homeModules.ripgrep ={ lib, pkgs, ... }:letinherit (lib.meta) getExe;package = pkgs.ripgrep;in{environment.sessionVariables = {RIPGREP_CONFIG_PATH = "/home/jam/.config/ripgrep/ripgreprc";};packages = [ package ];xdg.config.files."ripgrep/ripgreprc".text =''--line-number--smart-case'';};}
{config.flake.modules.homeModules.eza ={ pkgs, ... }:letpackage = pkgs.eza;in{programs.nushell.aliases = {ls = "eza";sl = "eza";ll = "eza -la";la = "eza -a";lsa = "eza -a";lsl = "eza -l -a";};packages = [ package ];};}
{config.flake.modules.homeModules.bat ={ lib, pkgs, ... }:letinherit (lib.meta) getExe;exe = getExe pkgs.bat;package = pkgs.bat;less = pkgs.less;in{environment.sessionVariables = {MANPAGER = "${exe} --plain";PAGER = "${exe} --plain";};programs.nushell.aliases = {cat = "${exe} --pager=${less} --quit-if-one-screen --RAW-CONTROL-CHARS";less = "${exe} --plain";};packages = [ package ];};}
# nu''$env.config.edit_mode = "vi"$env.config.buffer_editor = "hx"$env.config.show_banner = false$env.config.footer_mode = "auto"
# nu''$env.config.edit_mode = "vi"$env.config.buffer_editor = "${config.environment.sessionVariables.EDITOR}"$env.config.show_banner = false$env.config.footer_mode = "auto"
$env.config.completions.algorithm = "substring"$env.config.completions.sort = "smart"$env.config.completions.case_sensitive = false$env.config.completions.quick = true$env.config.completions.partial = true$env.config.completions.use_ls_colors = true
$env.config.completions.algorithm = "substring"$env.config.completions.sort = "smart"$env.config.completions.case_sensitive = false$env.config.completions.quick = true$env.config.completions.partial = true$env.config.completions.use_ls_colors = true
$env.config.table.trim.methodology = "wrapping"$env.config.table.trim.wrapping_try_keep_words = true$env.config.table.trim.truncating_suffix = "..."
$env.config.table.trim.methodology = "wrapping"$env.config.table.trim.wrapping_try_keep_words = true$env.config.table.trim.truncating_suffix = "..."
$env.config.history.file_format = "sqlite"$env.config.history.max_size = 10000000$env.config.history.sync_on_enter = true
$env.config.history.file_format = "sqlite"$env.config.history.max_size = 10000000$env.config.history.sync_on_enter = true
$env.config.cursor_shape.emacs = "block"$env.config.cursor_shape.vi_insert = "line"$env.config.cursor_shape.vi_normal = "block"
$env.config.cursor_shape.emacs = "block"$env.config.cursor_shape.vi_insert = "line"$env.config.cursor_shape.vi_normal = "block"
$env.config.explore.help_banner = true$env.config.explore.exit_esc = true$env.config.explore.command_bar_text = "#C4C9C6"$env.config.explore.highlight.bg = "yellow"$env.config.explore.highlight.fg = "black"
$env.config.explore.help_banner = true$env.config.explore.exit_esc = true$env.config.explore.command_bar_text = "#C4C9C6"$env.config.explore.highlight.bg = "yellow"$env.config.explore.highlight.fg = "black"
$env.config.explore.table.split_line = "#404040"$env.config.explore.table.cursor = true$env.config.explore.table.line_index = true$env.config.explore.table.line_shift = true$env.config.explore.table.line_head_top = true$env.config.explore.table.line_head_bottom = true$env.config.explore.table.show_head = true$env.config.explore.table.show_index = true
$env.config.explore.table.split_line = "#404040"$env.config.explore.table.cursor = true$env.config.explore.table.line_index = true$env.config.explore.table.line_shift = true$env.config.explore.table.line_head_top = true$env.config.explore.table.line_head_bottom = true$env.config.explore.table.show_head = true$env.config.explore.table.show_index = true
$env.config.keybindings = [{name: quit_shellmodifier: controlkeycode: char_dmode: emacsevent: null}{name: quit_shellmodifier: controlkeycode: char_dmode: vi_insertevent: null}{name: quit_shellmodifier: controlkeycode: char_dmode: vi_normalevent: null}]
$env.config.keybindings = [{name: quit_shellmodifier: controlkeycode: char_dmode: emacsevent: null}{name: quit_shellmodifier: controlkeycode: char_dmode: vi_insertevent: null}{name: quit_shellmodifier: controlkeycode: char_dmode: vi_normalevent: null}]
$env.config.hooks.display_output = {if (term size).columns >= 100 { tee { table --expand | print } } | try { if $in != null { $env.last = $in } }}
$env.config.hooks.display_output = {if (term size).columns >= 100 { tee { table --expand | print } } | try { if $in != null { $env.last = $in } }}
$env.config.hooks.pre_prompt = [{if not (which direnv | is-empty) {direnv export json | from json | default {} | load-env$env.PATH = ($env.PATH | split row (char env_sep))
$env.config.hooks.pre_prompt = [{if not (which direnv | is-empty) {direnv export json | from json | default {} | load-env$env.PATH = ($env.PATH | split row (char env_sep))}
envFile = with config.theme.withHash;#nu''use std/config ${config.theme.nushell}$env.config.color_config = (${config.theme.nushell})
envFile =with theme.withHash;#nu''use std/config ${theme.nushell}$env.config.color_config = (${theme.nushell})
$env.CARAPACE_BRIDGES = "zsh,fish,bash,inshellisense,clap"$env.LS_COLORS = (${pkgs.vivid}/bin/vivid generate ${config.theme.vivid})
$env.CARAPACE_BRIDGES = "zsh,fish,bash,inshellisense,clap"$env.LS_COLORS = (${pkgs.vivid}/bin/vivid generate ${theme.vivid})
let theme_json = $"($env.HOME)/nixos/modules/theme/theme.json"if ($theme_json | path exists) {let theme = (open $theme_json)$env.THEME_MODE = $theme.mode$env.THEME_SCHEME = $theme.scheme} else {$env.THEME_MODE = "${config.theme.variant}"$env.THEME_SCHEME = "${config.theme.color_scheme}"}
let theme_json = $"($env.HOME)/nixos/modules/theme.json"if ($theme_json | path exists) {let theme = (open $theme_json)$env.THEME_MODE = $theme.mode$env.THEME_SCHEME = $theme.scheme} else {$env.THEME_MODE = "${theme.variant}"$env.THEME_SCHEME = "${theme.color_scheme}"}
let status = if not ($exit_code == 0) or $transient {$"(ansi '${base0D}')┫(ansi rst)(if $exit_code == 0 { ansi '${base0D}' } else { ansi '${base08}' })($exit_code)(ansi rst)(ansi '${base0D}')┣(ansi rst)"} else {$"(ansi '${base0D}')━(ansi rst)"}
let status = if not ($exit_code == 0) or $transient {$"(ansi '${base0D}')┫(ansi rst)(if $exit_code == 0 { ansi '${base0D}' } else { ansi '${base08}' })($exit_code)(ansi rst)(ansi '${base0D}')┣(ansi rst)"} else {$"(ansi '${base0D}')━(ansi rst)"}
let dir = if ($jj_root | is-not-empty) {let subpath = $pwd | path relative-to $jj_rootlet subpath = if ($subpath | is-not-empty) {$"(ansi '${base0E}') ⟶ (ansi rst)(ansi '${base0B}')($subpath)(ansi rst)"}$"($jj_root | path basename)($subpath)"} else {let pwd = if ($pwd | str starts-with $env.HOME) {"~" | path join ($pwd | path relative-to $env.HOME)} else { $pwd }
let dir = if ($jj_root | is-not-empty) {let subpath = $pwd | path relative-to $jj_rootlet subpath = if ($subpath | is-not-empty) {$"(ansi '${base0E}') ⟶ (ansi rst)(ansi '${base0B}')($subpath)(ansi rst)"}$"($jj_root | path basename)($subpath)"} else {let pwd = if ($pwd | str starts-with $env.HOME) {"~" | path join ($pwd | path relative-to $env.HOME)} else { $pwd }
let jj_info = if (which jj | is-not-empty) {try {let jj_output = (^jj --quiet --color always --ignore-working-copy log --no-graph --revisions @ --template 'separate(" ",bookmarks.join(", "),if(empty, label("empty", "(empty)")),coalesce(surround("\"", "\"",if(description.first_line().substr(0, 22).starts_with(description.first_line()),description.first_line().substr(0, 22),description.first_line().substr(0, 21) ++ "…")),label(if(empty, "empty"), "")),change_id.shortest(),commit_id.shortest(),if(conflict, label("conflict", "(conflict)")),if(divergent, label("divergent prefix", "(divergent)")),if(hidden, label("hidden prefix", "(hidden)")),if(immutable, label("immutable", "(immutable)")),)' err> /dev/null | str trim)if ($jj_output | is-not-empty) {$" ($jj_output)"} else { "" }} catch { "" }} else { "" }
let jj_info = if (which jj | is-not-empty) {try {let jj_output = (^jj --quiet --color always --ignore-working-copy log --no-graph --revisions @ --template 'separate(" ",bookmarks.join(", "),if(empty, label("empty", "(empty)")),coalesce(surround("\"", "\"",if(description.first_line().substr(0, 22).starts_with(description.first_line()),description.first_line().substr(0, 22),description.first_line().substr(0, 21) ++ "…")),label(if(empty, "empty"), "")),change_id.shortest(),commit_id.shortest(),if(conflict, label("conflict", "(conflict)")),if(divergent, label("divergent prefix", "(divergent)")),if(hidden, label("hidden prefix", "(hidden)")),if(immutable, label("immutable", "(immutable)")),)' err> /dev/null | str trim)if ($jj_output | is-not-empty) {$" ($jj_output)"} else { "" }} catch { "" }} else { "" }
let ms = ($env.CMD_DURATION_MS | into int)let duration = if $transient or $ms > 1000 {let secs = $ms / 1000 | math floorif $transient and $ms < 1000 {$" (ansi '${base0A}')($ms)ms"} else {$" (ansi '${base0A}')($secs)s"}} else { "" }
let ms = ($env.CMD_DURATION_MS | into int)let duration = if $transient or $ms > 1000 {let secs = $ms / 1000 | math floorif $transient and $ms < 1000 {$" (ansi '${base0A}')($ms)ms"} else {$" (ansi '${base0A}')($secs)s"}} else { "" }
let prompt_line = [(char nl)$bar$status$bar$host" "$directory" "(if ($jj_info | is-not-empty) {[$"(ansi '${base0D}')━┫(ansi rst)"$jj_info$" (ansi '${base0D}')┣━(ansi rst)"] | str join} else {[$bar$bar$bar] | str join})$duration(char nl)] | str join
let prompt_line = [(char nl)$bar$status$bar$host" "$directory" "(if ($jj_info | is-not-empty) {[$"(ansi '${base0D}')━┫(ansi rst)"$jj_info$" (ansi '${base0D}')┣━(ansi rst)"] | str join} else {[$bar$bar$bar] | str join})$duration(char nl)] | str join
$env.PROMPT_COMMAND = { || prompt }$env.PROMPT_COMMAND_RIGHT = ""$env.TRANSIENT_PROMPT_COMMAND = { || prompt --transient }$env.TRANSIENT_PROMPT_COMMAND_RIGHT = ""
$env.PROMPT_COMMAND = { || prompt }$env.PROMPT_COMMAND_RIGHT = ""$env.TRANSIENT_PROMPT_COMMAND = { || prompt --transient }$env.TRANSIENT_PROMPT_COMMAND_RIGHT = ""
$env.PROMPT_INDICATOR = " "$env.PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR$env.PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR$env.PROMPT_MULTILINE_INDICATOR = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = $env.PROMPT_INDICATOR'';
$env.PROMPT_INDICATOR = " "$env.PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR$env.PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR$env.PROMPT_MULTILINE_INDICATOR = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = $env.PROMPT_INDICATOR'';
letbatConfig ={ lib, pkgs, ... }:letinherit (lib.meta) getExe;bat = getExe pkgs.bat;less = getExe pkgs.less;in{packages = [pkgs.batpkgs.less];environment.sessionVariables = {MANPAGER = "${bat} --plain";PAGER = "${bat} --plain";};rum.programs.nushell.aliases = {cat = "${bat} --pager=${less} --quit-if-one-screen --RAW-CONTROL-CHARS";less = "${bat} --plain";};};ripgrepConfig ={ pkgs, ... }:{packages = [pkgs.ripgrep];environment.sessionVariables = {RIPGREP_CONFIG_PATH = "/home/jam/.config/ripgrep/ripgreprc";};xdg.config.files."ripgrep/ripgreprc".text = ''--line-number--smart-case'';};ezaConfig ={ pkgs, ... }:{rum.programs.nushell.aliases = {ls = "eza";sl = "eza";ll = "eza -la";la = "eza -a";lsa = "eza -a";lsl = "eza -l -a";};packages = [pkgs.eza];};otherConfig ={ pkgs, ... }:{packages = [pkgs.btoppkgs.fastfetchpkgs.fdpkgs.fzfpkgs.jqpkgs.nix-indexpkgs.vivid];};in{config.flake.modules.hjem.shell-tools ={ pkgs, lib, ... }:letbat = batConfig { inherit pkgs lib; };ripgrep = ripgrepConfig { inherit pkgs; };eza = ezaConfig { inherit pkgs; };other = otherConfig { inherit pkgs; };in{packages = bat.packages ++ ripgrep.packages ++ eza.packages ++ other.packages;environment.sessionVariables =bat.environment.sessionVariables // ripgrep.environment.sessionVariables;rum.programs.nushell.aliases = bat.rum.programs.nushell.aliases // eza.rum.programs.nushell.aliases;xdg.config.files = ripgrep.xdg.config.files;};}
}# bash completion directory loadingif [ -d ${homeArgs.config.home.homeDirectory}/.bash_completion.d/ ]; thenfor i in ${homeArgs.config.home.homeDirectory}/.bash_completion.d/*.sh; doif [ -r $i ]; then. $ifidoneunset ifi'';};})];};initExtra = ''# Load theme state from theme.jsonif [ -f "$HOME/nixos/modules/common/theme/theme.json" ]; thenexport THEME_MODE=$(grep -o '"mode":"[^"]*"' "$HOME/nixos/modules/common/theme/theme.json" | cut -d'"' -f4)export THEME_SCHEME=$(grep -o '"scheme":"[^"]*"' "$HOME/nixos/modules/common/theme/theme.json" | cut -d'"' -f4)elseexport THEME_MODE="${config.theme.variant}"export THEME_SCHEME="${config.theme.color_scheme}"fi# fzf key bindingsif command -v fzf >/dev/null 2>&1; thenbind -m emacs-standard '"\C-f": " \C-b\C-k \C-u`__fzf_cd__`\e\C-e\er\C-m\C-y\C-h\e \C-y\ey\C-x\C-x\C-d"'bind -m emacs-standard -x '"\C-g": fzf-file-widget --height ~40%'fim = "moon";mp = "mprocs";ko = "kondo";{ config, lib, ... }: letinherit (lib) enabled;in {home-manager.sharedModules = [(homeArgs: {programs.bash = enabled {enableCompletion = true;shellAliases = config.environment.shellAliases // {".." = "cd ..";
}{ lib, pkgs, ... }: letinherit (lib) enabled;in {environment.systemPackages = [pkgs.carapacepkgs.fishpkgs.zsh];home-manager.sharedModules = [{programs.carapace = enabled;}];# pkgs.inshellisense
}{ lib, ... }: {imports = lib.collectNix ./.|> lib.remove ./default.nix;
letininherit (lib) enabled mkIf;{}}];nix-direnv = enabled;});home-manager.sharedModules = [{programs.direnv = mkIf config.isDesktop (enabled {enableNushellIntegration = true;{ lib, config, ... }:
home-manager.sharedModules = [{}];programs.eza = enabled;}{ lib, ... }: letinherit (lib) enabled;in {environment.shellAliases = {ls = "eza";sl = "eza";ll = "eza -la";la = "eza -a";lsa = "eza -a";lsl = "eza -l -a";};
def "cargo search" [query: string, --limit=10] {^cargo search $query --limit $limit| lines| each {|line| if ($line | str contains "#") {$line | parse --regex '(?P<name>.+) = "(?P<version>.+)" +# (?P<description>.+)'} else {$line | parse --regex '(?P<name>.+) = "(?P<version>.+)"'}}| flatten}def "cargo update-all" [--force] {cargo install --list| parse "{package} v{version}:"| get package| each {|p|if $force {cargo install --locked --force $p} else {cargo install --locked $p}}}def pwd [] {$env.PWD | str replace $nu.home-path '~'}--count (-n): int = 999999] {try {git log $"--pretty=%h»¦«%aN»¦«%s»¦«%aD" $"-($count)"| lines| split column "»¦«" sha1 committer desc merged_at| histogram committer merger| sort-by merger| reverse} catch {print "Error: Make sure you're in a git repository"}}| table -i 1 # start index from 1def "git summary" [def zellij-update-tabname [] {if ("ZELLIJ" in $env) {let tab_name = if ((pwd) == $env.HOME) {"~"} else {(pwd | path parse | get stem)};zellij action rename-tab $tab_name;}}
# menus$env.config.menus = [{name: completion_menuonly_buffer_difference: falsemarker: "| "type: {}style: {description_text: yellow}}{name: history_menuonly_buffer_difference: truemarker: "? "type: {layout: listpage_size: 10}style: {}}{name: help_menuonly_buffer_difference: truemarker: "? "type: {layout: descriptioncolumns: 4col_width: 20col_padding: 2selection_rows: 4description_rows: 10}style: {text: greenselected_text: green_reversedescription_text: yellow}}{name: commands_menuonly_buffer_difference: falsemarker: "# "type: {layout: columnarcolumns: 4col_width: 20col_padding: 2}style: {text: greenselected_text: green_reversedescription_text: yellow}source: { |buffer, position|$nu.scope.commands| where name =~ $buffer| each { |it| {value: $it.name description: $it.usage} }}}{name: vars_menuonly_buffer_difference: truemarker: "# "type: {layout: listpage_size: 10}style: {text: greenselected_text: green_reversedescription_text: yellow}source: { |buffer, position|$nu.scope.vars| where name =~ $buffer| sort-by name| each { |it| {value: $it.name description: $it.type} }}}{name: commands_with_descriptiononly_buffer_difference: truemarker: "# "type: {layout: descriptioncolumns: 4col_width: 20col_padding: 2selection_rows: 4description_rows: 10}style: {text: greenselected_text: green_reversedescription_text: yellow}source: { |buffer, position|$nu.scope.commands| where name =~ $buffer| each { |it| {value: $it.name description: $it.usage} }}}]text: greenselected_text: green_reversematch_text: { attr: u }selected_match_text: { attr: ur }text: greenselected_text: green_reverselayout: idemin_completion_width: 0max_completion_width: 150max_completion_height: 25padding: 0border: falsecursor_offset: 0description_mode: "prefer_right"min_description_width: 0max_description_width: 50max_description_height: 10description_offset: 1correct_cursor_pos: true
inherit (lib) enabled;'';}};})];$env.CARAPACE_BRIDGES = "zsh,fish,bash,inshellisense,clap"$env.LS_COLORS = (${pkgs.vivid}/bin/vivid generate ${config.theme.vivid})# Load theme state from theme.jsonlet theme_json = $"($env.HOME)/nixos/modules/common/theme/theme.json"if ($theme_json | path exists) {let theme = (open $theme_json)$env.THEME_MODE = $theme.mode$env.THEME_SCHEME = $theme.scheme} else {$env.THEME_MODE = "${config.theme.variant}"$env.THEME_SCHEME = "${config.theme.color_scheme}"}# Custom Nushell prompt.def prompt [--transient]: nothing -> string {let exit_code = $env.LAST_EXIT_CODElet status = if not ($exit_code == 0) or $transient {$"(ansi '${base0D}')┫(ansi rst)(if $exit_code == 0 { ansi '${base0D}' } else { ansi '${base08}' })($exit_code)(ansi rst)(ansi '${base0D}')┣(ansi rst)"} else {$"(ansi '${base0D}')━(ansi rst)"}let host = if ($env.SSH_CONNECTION? | is-not-empty) {} else { "" }let jj_root = try {jj workspace root err> /dev/null} catch { "" }let directory = $"(ansi '${base0A}')($dir)(ansi rst)"let jj_info = if (which jj | is-not-empty) {try {let jj_output = (^jj --quiet --color always --ignore-working-copy log --no-graph --revisions @ --template 'separate(" ",bookmarks.join(", "),if(empty, label("empty", "(empty)")),coalesce(surround("\"", "\"",if()),label(if(empty, "empty"), "")),change_id.shortest(),commit_id.shortest(),if(conflict, label("conflict", "(conflict)")),if(divergent, label("divergent prefix", "(divergent)")),if(hidden, label("hidden prefix", "(hidden)")),if(immutable, label("immutable", "(immutable)")),)' err> /dev/null | str trim)if ($jj_output | is-not-empty) {$" ($jj_output)"} else { "" }} catch { "" }} else { "" }let ms = ($env.CMD_DURATION_MS | into int)let duration = if $transient or $ms > 1000 {let secs = $ms / 1000 | math floorif $transient and $ms < 1000 {$" (ansi '${base0A}')($ms)ms"} else {$" (ansi '${base0A}')($secs)s"}} else { "" }let bar = $"(ansi '${base0D}')(ansi attr_bold)━(ansi rst)"let prompt_line = [(char nl)$bar$status$bar$host" "$directory" "(if ($jj_info | is-not-empty) {[$"(ansi '${base0D}')━┫(ansi rst)"$jj_info$" (ansi '${base0D}')┣━(ansi rst)"] | str join} else {[$bar$bar$bar] | str join})$duration(char nl)] | str join$prompt_line}# Set prompt$env.PROMPT_COMMAND = { || prompt }$env.PROMPT_COMMAND_RIGHT = ""$env.TRANSIENT_PROMPT_COMMAND = { || prompt --transient }$env.TRANSIENT_PROMPT_COMMAND_RIGHT = ""$env.PROMPT_INDICATOR = " "$env.PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR$env.PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR$env.PROMPT_MULTILINE_INDICATOR = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR$env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = $env.PROMPT_INDICATORdescription.first_line().substr(0, 22).starts_with(description.first_line()),description.first_line().substr(0, 22),description.first_line().substr(0, 21) ++ "…"let pwd = pwd | path expandlet dir = if ($jj_root | is-not-empty) {let subpath = $pwd | path relative-to $jj_rootlet subpath = if ($subpath | is-not-empty) {$"(ansi '${base0E}') ⟶ (ansi rst)(ansi '${base0B}')($subpath)(ansi rst)"}$"($jj_root | path basename)($subpath)"} else {let pwd = if ($pwd | str starts-with $env.HOME) {"~" | path join ($pwd | path relative-to $env.HOME)} else { $pwd }$pwd}$" (ansi '${base0B}')(hostname)(ansi rst)"# use std/config ${config.theme.nushell}# $env.config.color_config = (${config.theme.nushell})in {home-manager.sharedModules = [(homeArgs: {programs.nushell = enabled {shellAliases = config.environment.shellAliases // {m = "moon";mp = "mprocs";ko = "kondo";settings = {use_ansi_coloring = "auto";hooks.pre_prompt = [}''];if not (which direnv | is-empty) {direnv export json | from json | default {} | load-env$env.PATH = ($env.PATH | split row (char env_sep))/* nu */ ''hooks.display_output = /* nu */ '''';if (term size).columns >= 100 { tee { table --expand | print } } | try { if $in != null { $env.last = $in } }hooks.env_change.PWD = [/* nu */ ''{ |before, after| zellij-update-tabname }''];float_precision = 2;cursor_shape.emacs = "block";cursor_shape.vi_normal = "block";cursor_shape.vi_insert = "line";filesize = {};history.file_format = "sqlite";history.max_size = 10000000;history.sync_on_enter = true;};${builtins.readFile ./menus.nu}${builtins.readFile ./functions.nu}'';envFile.text = with config.theme.withHash; /* nu */ ''# $env.config.hooks.command_not_found = {|c|# try {# print $"(ansi purple)[FALLBACK](ansi rst) Command not found '($c)'"# print $"(ansi purple)[FALLBACK](ansi rst) Trying with comma."# let pkg = ($c | str trim)# let pkgs = (comma --print-packages ($pkg))# if ($pkgs | str downcase | str contains "no packages") { null }# comma --ask ($pkg)# null# } catch { null }# }extraConfig = /* nu */ ''table.mode = "compact";table.index_mode = "always";table.show_empty = true;table.trim.methodology = "wrapping";table.trim.wrapping_try_keep_words = true;table.trim.truncating_suffix = "...";explore.help_banner = true;explore.exit_esc = true;explore.command_bar_text = "#C4C9C6";explore.status_bar_background = {};explore.highlight.fg = "black";explore.status = {};explore.try = {};explore.table.split_line = "#404040";explore.table.cursor = true;explore.table.line_index = true;explore.table.line_shift = true;explore.table.line_head_top = true;explore.table.line_head_bottom = true;explore.table.show_head = true;explore.table.show_index = true;explore.config.cursor_color.bg = "yellow";explore.config.cursor_color.fg = "black";explore.highlight.bg = "yellow";keybindings = [{modifier = "control";}];keycode = "char_d";mode = [ "emacs" "vi_insert" "vi_normal" ];event = null;name = "quit_shell";rm.always_trash = false;show_banner = false;footer_mode = "auto";recursion_limit = 100;ls.use_ls_colors = true;ls.clickable_links = true;completions.algorithm = "substring";completions.sort = "smart";completions.case_sensitive = false;completions.quick = true;completions.partial = true;completions.use_ls_colors = true;error_style = "fancy";edit_mode = "vi";buffer_editor = config.environment.variables.EDITOR;};# Deletes the last 5 entries from the nushell history sqlite database.oops = "nix run nixpkgs#sqlite -- ${homeArgs.config.home.homeDirectory}/.config/nushell/history.sqlite3 'DELETE FROM history WHERE rowid IN (SELECT rowid FROM history ORDER BY rowid DESC LIMIT 5);'";# Open current repository in GitHub.repo = /* nu */ ''if (^git rev-parse --is-inside-work-tree | complete | get exit_code) == 0 {start (^git remote get-url origin | str replace "git@github.com:" "https://github.com/")} else {print "Not in a Git directory."${pkgs.libnotify}/bin/notify-send "Repo" "Failed to open repository. Not in a Git directory."exit 1}'';fj = "fj --host https://git.plumj.am";tree = "eza --tree --git-ignore --group-directories-first";swarm = "mprocs claude claude claude claude claude";rm = "rm --recursive --verbose";cp = "cp --recursive --verbose --progress";mv = "mv --verbose";mk = "mkdir";td = "hx ${homeArgs.config.home.homeDirectory}/notes/todo.md";notes = "hx ${homeArgs.config.home.homeDirectory}/notes";random = "hx ${homeArgs.config.home.homeDirectory}/notes/random.md";{ pkgs, config, lib, ... }: let
{options = [ "--cmd cd" ];};}];enableBashIntegration = true;enableNushellIntegration = true;}home-manager.sharedModules = [{programs.zoxide = {enable = true;
{}home-manager.sharedModules = [{programs.ripgrep = {enable = true;arguments = [ "--line-number" "--smart-case" ];};}];
{}home-manager.sharedModules = [{programs.fzf.enable = true;}];
{}home-manager.sharedModules = [{programs.fd.enable = true;}];
{}home-manager.sharedModules = [{programs.btop.enable = true;}];
inherit (lib) enabled;};};}home-manager.sharedModules = [{programs.less = enabled;programs.bat = enabled {config.pager = "less --quit-if-one-screen --RAW-CONTROL-CHARS";};}];environment.shellAliases = {cat = "bat";less = "bat --plain";environment.variables = {MANPAGER = "bat --plain";PAGER = "bat --plain";in {{ lib, pkgs, ... }: let