YQHYDW47JG225XJX56JC2BKU6A7KCTQ7BZEZCSI2EJCCTLCUBUVQC 3MYK6W7RI2HWNJ3AK4VKVUBCGZ75M4L6DIHRLUZLOL4OHGG3GG7AC QYZI7WAY5QWGDDJF7RQGVVNZ4LZCBOOKTTNJDEFTMMDK3ZXP6CTAC AGKZEZ3K2L57HMRD43CDF46IQT6SQSHKCCDNXMO7JIYKB67JRCWAC 35OZJAT76BQL42U5QYHMM6KGWQX5PIE33ZBAYWT3FIC2UBERGQSQC AONHENHZ3UBY7OTPGKFBPFPMDJONJW7PA55YLN7YH3SL3X4V5BRQC RTBMBSBABSGTRICJ4AWBKWO3JJHBRKV6FGOMYPDD7X6SS6X35ZIQC VLQ45OFB6Q2PBFEV2LCV2UINWGUL5YFD4MJ3PWP464VZWLD75HAQC MQT74AV47PUYNCX27OMFK6BFN7PP4DX46JAACN2EPRYXUXV7EL3AC YVII7NUI5Z6DPUDQZG2ZVJ6QNQRCEUYX5547IYCMPZI7GJ3GDZQAC EI6RKRFQK7NXVUAD675ZYCC6VS5LMDKLYFW3IP35LZ37XPCSLCXQC F3OZZWT5KGVRHEGKWUPO4PGRAZGCGO37LZNQFDIV45RRXO66IXHQC OAEKH6K2OSMVEXCRQXUTVAQRQZIZCXGI7EBMUVGNE6XPROLVLM5QC V2RX2Y7VB7Y3BHX3ALK4GTCMFJATMLCKIAT4U3XCYZZZIUBIIZ5QC TSX4OAMHBTCC3T6IK3HDNQYKI2GTW7PG7XFAGI2HOKIVLXK42G4AC AOGOOIMLV2JI2VBXZYBY57RHR4DLKAMIR5W63FP4TKTXVHFQAKLAC UDMIMNC47TNUHDGEKHD43MTZKGXVHZANX233UVMMS2AMUV53X2KQC L3FL72VOXEXA4K6YWPCATI5D4Q2275R7KVSMQHXU7K7S3FBXCMSQC {};}};integrations.nushell.enable = true;flags = [ "--cmd cd" ];rum.programs.zoxide = {enable = true;flake.modules.hjem.zoxide = {
inherit (lib.meta) getExe;aliases = {mp = "mprocs";todo = "hx ${config.directory}/notes/todo.md";notes = "hx ${config.directory}/notes";random = "hx ${config.directory}/notes/random.md";rm = "rm --recursive --verbose";cp = "cp --recursive --verbose --progress";mv = "mv --verbose";mk = "mkdir";ls = "eza";sl = "eza";ll = "eza -la";la = "eza -a";lsa = "eza -a";lsl = "eza -l -a";tree = "eza --tree --git-ignore --group-directories-first";swarm = "mprocs claude claude claude claude claude";fj = "fj --host https://git.plumj.am";oops = "nix run nixpkgs#sqlite -- ${config.directory}/.config/nushell/history.sqlite3 'DELETE FROM history WHERE rowid IN (SELECT rowid FROM history ORDER BY rowid DESC LIMIT 5);'";cat = "${getExe pkgs.bat}";less = "${getExe pkgs.bat} --plain";mosh = "mosh --no-init";dc = "discordo";ns = "niri-session";h = "hx";e = "hx"; # editorj = "jj";lj = "lazyjj";ju = "jjui";claude = "claude --continue --fork-session";codex = "codex resume --ask-for-approval untrusted";oc = "opencode --continue";};zoxideNushellIntegration = # nu''source ${pkgs.runCommand "zoxide-init-nu" { } ''${getExe pkgs.zoxide} init nushell --cmd=cd >> "$out"''}'';
integrations = {nushell.enable = true;nix-direnv.enable = true;};};
xdg.config.files."nushell/config.nu".text =# nu''${lib.concatStringsSep "\n" (lib.mapAttrsToList (name: val: "alias ${name} = ${val}") aliases)}$env.config.edit_mode = "vi"$env.config.buffer_editor = "${config.environment.sessionVariables.EDITOR}"$env.config.show_banner = false$env.config.footer_mode = "auto"
aliases = {m = "moon";mp = "mprocs";ko = "kondo";
$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
oops = "nix run nixpkgs#sqlite -- ${config.directory}/.config/nushell/history.sqlite3 'DELETE FROM history WHERE rowid IN (SELECT rowid FROM history ORDER BY rowid DESC LIMIT 5);'";};
$env.config.cursor_shape.emacs = "block"$env.config.cursor_shape.vi_insert = "line"$env.config.cursor_shape.vi_normal = "block"
extraConfig =# 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.float_precision = 2$env.config.use_ansi_coloring = "auto"
$env.config.recursion_limit = 100$env.config.error_style = "fancy"
$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.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.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.rm.always_trash = false
$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.history.file_format = "sqlite"$env.config.history.max_size = 10000000$env.config.history.sync_on_enter = true
$env.config.hooks.display_output = {if (term size).columns >= 100 { tee { table --expand | print } } | try { if $in != null { $env.last = $in } }}
$env.config.cursor_shape.emacs = "block"$env.config.cursor_shape.vi_insert = "line"$env.config.cursor_shape.vi_normal = "block"
$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.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
source $"($nu.cache-dir)/carapace.nu"source $"($nu.cache-dir)/jj.nu"'';
$env.config.explore.config.cursor_color.bg = "yellow"$env.config.explore.config.cursor_color.fg = "black"
xdg.config.files."nushell/env.nu".text =with theme.withHash;#nu''use std/config ${theme.nushell}$env.config.color_config = (${theme.nushell})
$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.CARAPACE_BRIDGES = "zsh,fish,bash,inshellisense,clap,jj,nu"mkdir $"($nu.cache-dir)"carapace _carapace nushell | save --force $"($nu.cache-dir)/carapace.nu"
$env.config.hooks.display_output = {if (term size).columns >= 100 { tee { table --expand | print } } | try { if $in != null { $env.last = $in } }}
# let carapace_completer = {|spans: list<string>|# # If the current command is an alias, get it's expansion.# let expanded_alias = (scope aliases | where name == $spans.0 | get -i 0 | get -i expansion)
$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))}}]
# # Overwrite.# let spans = (if $expanded_alias != null {# # put the first word of the expanded alias first in the span# $spans | skip 1 | prepend ($expanded_alias | split row " " | take 1)# } else { $spans })
envFile =with theme.withHash;#nu''use std/config ${theme.nushell}$env.config.color_config = (${theme.nushell})
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.colorScheme}"}
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.colorScheme}"}
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 pwd = pwd | path expand
let host = if ($env.SSH_CONNECTION? | is-not-empty) {$" (ansi '${base0B}')(hostname)(ansi rst)"} else { "" }
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 }$pwd}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(description.first_line().substr(0, 26).starts_with(description.first_line()),description.first_line().substr(0, 26),description.first_line().substr(0, 25) ++ "…")),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)
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, 26).starts_with(description.first_line()),description.first_line().substr(0, 26),description.first_line().substr(0, 25) ++ "…")),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)
# Only show parent bookmark if current change has no bookmarks.let jj_has_bookmark = (jj --quiet --color always log --no-graph --revisions @ --template 'bookmarks.len() > 0' err> /dev/null | str trim) == "true"let jj_parent = if not $jj_has_bookmark {(jj --quiet --color always --ignore-working-copy log --no-graph --revisions 'heads(::@ & bookmarks())' --template 'bookmarks ++ "\n"' err> /dev/null | lines | str join ",")} else { "" }
# Only show parent bookmark if current change has no bookmarks.let jj_has_bookmark = (jj --quiet --color always log --no-graph --revisions @ --template 'bookmarks.len() > 0' err> /dev/null | str trim) == "true"let jj_parent = if not $jj_has_bookmark {(jj --quiet --color always --ignore-working-copy log --no-graph --revisions 'heads(::@ & bookmarks())' --template 'bookmarks ++ "\n"' err> /dev/null | lines | str join ",")} else { "" }
let combined = if ($jj_parent_display | is-not-empty) and ($jj_output | is-not-empty) {$" ($jj_parent_display) ($jj_output)"} else if ($jj_parent_display | is-not-empty) {$" ($jj_parent_display)"} else if ($jj_output | is-not-empty) {$" ($jj_output)"} else { "" }$combined} catch { "" }} else { "" }
let combined = if ($jj_parent_display | is-not-empty) and ($jj_output | is-not-empty) {$" ($jj_parent_display) ($jj_output)"} else if ($jj_parent_display | is-not-empty) {$" ($jj_parent_display)"} else if ($jj_output | is-not-empty) {$" ($jj_output)"} else { "" }$combined} 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'';