summaryrefslogtreecommitdiff
path: root/.config/nushell/login.nu
blob: 4ca972e2a1710be5202b221d6e3a71011f7f173b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def load-posix-env [p: string] {
    bash -c $"source ($p) && env"
        | lines
        | parse "{n}={v}"
        | filter { |x| ($x.n not-in $env) or $x.v != ($env | get $x.n) }
        | where n not-in ["_", "LAST_EXIT_CODE", "DIRS_POSITION"]
        | transpose --header-row
        | into record
        | load-env
}

load-posix-env /etc/profile
# load-posix-env $"($env.HOME)/.profile"
$env.PATH = $env.PATH ++ [$"($env.HOME)/.local/bin"]