Skip to content

Commit f98a136

Browse files
committed
add nix
1 parent 8f099c7 commit f98a136

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

init-script/install/__init__.py

+20
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,26 @@ def install_paru():
298298
)
299299

300300

301+
def post_install_nix():
302+
rc("exec bash")
303+
output = rc("nix-channel --list", capture_output=True, text=True).stdout.strip()
304+
if "unstable" not in output:
305+
rc_sudo("nix-channel --add https://nixos.org/channels/nixpkgs-unstable")
306+
rc_sudo("nix-channel --update")
307+
308+
309+
packages_list.add(
310+
Package(
311+
"nix",
312+
0,
313+
pre_install_fun=lambda: True,
314+
install_fun=lambda: rc_sudo(
315+
"sh <(curl -L https://nixos.org/nix/install) --daemon --yes"
316+
),
317+
post_install_fun=post_install_nix,
318+
)
319+
)
320+
301321
packages_list.add(
302322
Package(
303323
"trojan",

0 commit comments

Comments
 (0)