C.W.K.
Stream
Lesson 02 of 05 · published

Nix 살아남는 방식으로 설치

~12 min · nix, installation, determinate-systems

Level 0초심자
0 XP0/55 lessons0/16 achievements
0/80 XP to next level80 XP to go0% complete

macOS 용 Nix installer 두 개 — 공식 + Determinate Systems installer. Determinate 거 써. 같은 Nix 인데 Mac 에서 중요한 두 가지 실용적 차이.

첫째, Determinate installer 는 macOS 메이저 업그레이드를 살아남아. 공식 installer 는 macOS 가 가끔 메이저 버전 점프 때 쓸어버리는 synthetic /nix mount 에 의존; 깨진 Nix install 로 깨어나. Determinate 거는 macOS 가 안 건드리는 자기 APFS 볼륨에 /nix 둠.

둘째, 깨끗한 uninstaller 가짐. /nix/nix-installer uninstall 돌리면 Mac 이 pre-Nix 상태로 돌아감. 공식 installer 의 제거 과정은 multi-step 이고 botch 하기 쉬움.

install 후 terminal 재시작 (또는 새 shell init source), nix --version 으로 검증. flakes 와 새 nix 명령 둘 다 디폴트로 활성화된 Nix 2.x 받음 — 그게 모던 셋업. 'nix.conf 편집해서 flakes 활성화' 라는 docs 보면 옛 docs 읽는 거; Determinate installer 가 두 flag 다 켜놨음.

Code

Nix install (Determinate Systems — 권장)·bash
# Install
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

# Terminal 재시작, 검증
nix --version
# nix (Nix) 2.x.x

# flakes + nix 명령 활성화 확인
nix flake --help     # 'experimental feature' 안 떠야 함
깨끗하게 uninstall (필요할 때)·bash
# Determinate 의 installer 가 자기 uninstaller 가짐
/nix/nix-installer uninstall

# 뭐 제거할지 confirm, 권한 묻고, 깨끗하게 revert.
# 끝나면 Mac 이 pre-Nix 상태로 돌아감.

External links

Exercise

Determinate installer 통해 Nix install. 'nix --version' 으로 확인. 그 다음 'nix shell nixpkgs#cowsay' — prompt 돌아오면 'cowsay hello' 치고 소가 말하는 거 봐. shell 종료 ('exit' 또는 Ctrl-D); cowsay 가 PATH 에서 사라져. 이 ephemeral-shell 트릭이 Nix 의 가장 중독성 있는 기능.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.