-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-windows
More file actions
executable file
·162 lines (140 loc) · 3.98 KB
/
install-windows
File metadata and controls
executable file
·162 lines (140 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/usr/bin/env nu
# Relaunch using Windows nushell if started from WSL.
if $nu.os-info.name == "linux" {
let nu_exe = $"($env.HOME)/winhome/.local/bin/nu.exe"
if not ($nu_exe | path exists) {
exit
}
^$nu_exe $env.CURRENT_FILE
exit
}
use nushell/scripts/globals.nu
use nushell/scripts/log.nu
use nushell/scripts/windows.nu
use nushell/scripts/setup
use nushell/scripts/nu-install
let file_pwd = $env.FILE_PWD
$env.LOG_CATEGORY = "install-windows"
log info "Starting"
# Run everything from the Windows home directory, since some tools don't like being run from the WSL UNC path.
cd $env.HOME
windows set-user-env {
EDITOR: "neovide"
HOME: $env.HOME?
NODE_UNC_HOST_ALLOWLIST: "wsl.localhost"
Path: (
[
($env.HOME | path join .local bin)
($env.HOME | path join .cargo bin)
($env.HOME | path join .local share bob nvim-bin)
($env.HOME | path join scoop shims)
...(
registry query --hkcu Environment Path
| get value
| split row (char esep)
)
]
| compact -e
| path expand --no-symlink
| uniq
| str join (char esep)
)
RIPGREP_CONFIG_PATH: $env.RIPGREP_CONFIG_PATH?
WSLHOME: ($file_pwd | path dirname)
XDG_CACHE_HOME: $env.XDG_CACHE_HOME?
XDG_CONFIG_HOME: $env.XDG_CONFIG_HOME?
XDG_DATA_HOME: $env.XDG_DATA_HOME?
XDG_STATE_HOME: $env.XDG_STATE_HOME?
YAZI_FILE_ONE: ($env.HOME | path join scoop apps git current usr bin file.exe)
}
# Pull latest changes from our github repo first.
nu-install git [
{ repo: "https://github.com/sid-6581/dotfiles", dir: ($env.HOME | path join .dotfiles) }
]
nu-install link clean
nu-install link [
{ target: ($env.HOME | path join .dotfiles nushell), link: ($env.HOME | path join .config nushell) }
{ target: ($env.HOME | path join .dotfiles config), link: $env.HOME }
{ target: ($env.HOME | path join .dotfiles config-windows), link: $env.HOME }
{ target: ($env.HOME | path join .dotfiles config .config yazi), link: ($env.HOME | path join AppData Roaming yazi config) }
]
# Remove scoop application that may have been installed before.
nu-install scoop uninstall --apps [
neovim
neovim-nightly
]
nu-install winget [
Microsoft.PowerShell
AutoHotkey.AutoHotkey
]
nu-install scoop --buckets [
extras
versions
nerd-fonts
] --apps [
JetBrainsMono-NF
bat
broot
carapace-bin
cmake
delta
fd
fzf
gh
git
jq
just
lazygit
llvm
lsd
nodejs
packer
pnpm
python
ripgrep
sed
starship
sudo
sysinternals
tealdeer
uutils-coreutils
wezterm-nightly
which
win32yank
xsv
yazi
zoxide
]
^sudo.cmd $"($env.HOME)/.local/bin/nu" $"($env.HOME)/.dotfiles/install-windows-sudo.nu"
nu-install git [
{ repo: "https://github.com/sid-6581/dotfiles", dir: ($env.HOME | path join .dotfiles) }
{ repo: "https://github.com/sid-6581/NeovimConfig", dir: ($env.HOME | path join .config nvim) }
]
if (which rustup | is-empty) {
if (^winget list --accept-source-agreements | find "VisualStudio" | is-empty) {
log warning "Visual Studio not installed, skipping installation of rustup"
} else {
nu-install winget [ Rustlang.Rustup ]
^rustup -q toolchain install nightly
}
}
nu-install cargo [
cargo-edit
cargo-sweep
cargo-update
x12pp
]
nu-install gh [
{ repo: "nushell/nushell", pattern: "*x86_64-pc-windows-msvc.zip" } # nushell - Shell
{ repo: "rust-lang/rust-analyzer", pattern: "rust-analyzer-x86_64-pc-windows-msvc.zip" } # rust-analyzer - LSP for rust
{ repo: "MordechaiHadad/bob", pattern: "bob-windows-x86_64.zip" } # bob - Neovim version manager
]
if (which bob | is-empty) {
log warning "bob not installed, skipping installation of neovim"
} else if (^bob list | find used | is-empty) {
log info "Installing neovim"
^bob use nightly
}
if not ($"($env.HOME)/.wslconfig" | path exists) {
"[wsl2]\nkernelCommandLine = cgroup_no_v1=all\nnetworkingMode = nat" | save -f ($env.HOME | path join .wslconfig)
}