nix.md 1.3 KB

nix

ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ๋ฅผ ์‹ ๋ขฐ์„ฑ ์žˆ๊ณ , ์žฌํ˜„ ๊ฐ€๋Šฅํ•˜๋ฉฐ, ์„ ์–ธ์ ์œผ๋กœ ๋งŒ๋“œ๋Š” ๊ฐ•๋ ฅํ•œ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ์ž. nix๋Š” ์‹คํ—˜์ ์ด๋ฉฐ ์‹คํ—˜์  ๊ธฐ๋Šฅ ์‚ฌ์šฉ์„ ํ™œ์„ฑํ™”ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์•ˆ์ •์ ์ธ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์›ํ•˜๋ฉด tldr nix classic์„ ์ฐธ์กฐํ•˜์„ธ์š”. build, develop, flake, registry, profile, search, repl, store, edit, why-depends ๋“ฑ์˜ ์ผ๋ถ€ ํ•˜์œ„ ๋ช…๋ น์—๋Š” ์ž์ฒด ์‚ฌ์šฉ ์„ค๋ช…์„œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋” ๋งŽ์€ ์ •๋ณด: https://nixos.org/manual/nix.

  • nix ๋ช…๋ น ํ™œ์„ฑํ™”:

mkdir -p ~/.config/nix; echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf

  • nixpkgs์—์„œ ์ด๋ฆ„์ด๋‚˜ ์„ค๋ช…์œผ๋กœ ํŒจํ‚ค์ง€ ๊ฒ€์ƒ‰:

nix search nixpkgs {{๊ฒ€์ƒ‰์–ด}}

  • nixpkgs์—์„œ ์ง€์ •ํ•œ ํŒจํ‚ค์ง€๊ฐ€ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์…ธ ์‹œ์ž‘:

nix shell {{nixpkgs#ํŒจํ‚ค์ง€1 nixpkgs#ํŒจํ‚ค์ง€2 nixpkgs#ํŒจํ‚ค์ง€3 ...}}

  • nixpkgs์—์„œ ์ผ๋ถ€ ํŒจํ‚ค์ง€๋ฅผ ์˜๊ตฌ์ ์œผ๋กœ ์„ค์น˜:

nix profile install {{nixpkgs#ํŒจํ‚ค์ง€1 nixpkgs#ํŒจํ‚ค์ง€2 nixpkgs#ํŒจํ‚ค์ง€3 ...}}

  • Nix ์ €์žฅ์†Œ์—์„œ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๊ฒฝ๋กœ ์ œ๊ฑฐํ•˜์—ฌ ๊ณต๊ฐ„ ํ™•๋ณด:

nix store gc

  • Nix ํ‘œํ˜„์‹์„ ํ‰๊ฐ€ํ•˜๊ธฐ ์œ„ํ•œ ๋Œ€ํ™”ํ˜• ํ™˜๊ฒฝ ์‹œ์ž‘:

nix repl

  • ํŠน์ • ํ•˜์œ„ ๋ช…๋ น์— ๋Œ€ํ•œ ๋„์›€๋ง ํ‘œ์‹œ:

nix help {{ํ•˜์œ„_๋ช…๋ น}}