repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell/login.nu

Raw
use prompt.nu
use sy.nu
use wezterm_integration.nu
use md.nu
use todo.nu
use ssh.nu *
use vim.nu
use btrfs.nu
use start.nu
use dwnld.nu
use notes.nu
use yazi.nu *
use akku.nu
use colors.nu
use commands.nu *
use syncthing.nu
use minimax.nu
use zai.nu
use kimi.nu
use shim.nu
use git.nu
use work_scope.nu

use std/clip

export def vx [...rest] {
	NVIM_APPNAME=nvim-minimax nvim ...$rest
}

let save_if_changed = {|path: path, content: string|
    if (not ($path | path exists)) or ((open --raw $path) != $content) {
        $content | save --force $path
    }
}

let zoxide_config_path = ($nu.default-config-dir | path join "zoxide.nu")
if not (which zoxide | is-empty) {
    do $save_if_changed $zoxide_config_path (zoxide init nushell)
} else {
    do $save_if_changed $zoxide_config_path ""
}

let vendor_dir = ($nu.vendor-autoload-dirs | last)
mkdir $vendor_dir

if not (which mise | is-empty) {
    let mise_config = (
        ^mise activate nu
        | str replace --all "str upcase" "str uppercase"
        | str replace --all "str downcase" "str lowercase"
    )
    do $save_if_changed ($vendor_dir | path join "mise.nu") $mise_config
}

if not (which niri | is-empty) {
    do $save_if_changed ($vendor_dir | path join "niri.nu") (^niri completions nushell)
}

source ($nu.default-config-dir | path join 'secrets.nu')
source ($nu.default-config-dir | path join "zoxide.nu")

work_scope generate