Skip to content

Commit 54b8edd

Browse files
authored
Create setup_idx.nix
1 parent c8aa5ee commit 54b8edd

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

Misc/Cloud/setup_idx.nix

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{ pkgs, ... }: {
2+
channel = "unstable";
3+
packages = [
4+
];
5+
env = { };
6+
idx = {
7+
extensions = [
8+
];
9+
previews = {
10+
enable = true;
11+
previews = { };
12+
};
13+
#Workspace lifecycle hooks
14+
workspace = {
15+
onCreate = {
16+
default.openFiles = [ ".idx/dev.nix" "README.md" ];
17+
};
18+
#Runs when the workspace is (re)started
19+
onStart = {
20+
#Install SOAR and ensure it's in the PATH
21+
setup = ''
22+
#Debloat
23+
rm -rf "$HOME/.android"* 2>/dev/null
24+
rm -rf "$HOME/.emu" 2>/dev/null
25+
rm -rf "$HOME/.npm" 2>/dev/null
26+
27+
#Install SOAR
28+
curl -fsSL 'https://soar.qaidvoid.dev/install.sh' | sh
29+
mkdir -p "$HOME/.local/share/soar/bin"
30+
if [ -f "./soar" ]; then
31+
mv "./soar" "$HOME/.local/share/soar/bin/soar"
32+
chmod +x "$HOME/.local/share/soar/bin/soar"
33+
if [ ! -s "$HOME/.config/soar/config.toml" ]; then
34+
"$HOME/.local/share/soar/bin/soar" defconfig --external
35+
fi
36+
fi
37+
if [ -f "$HOME/.bashrc" ]; then
38+
if ! grep -q "export PATH=\$PATH:\$HOME/.local/share/soar/bin" "$HOME/.bashrc"; then
39+
echo 'export PATH=$PATH:$HOME/.local/share/soar/bin' >> "$HOME/.bashrc"
40+
fi
41+
fi
42+
export PATH="$PATH:$HOME/.local/share/soar/bin"
43+
'';
44+
};
45+
};
46+
};
47+
}

0 commit comments

Comments
 (0)