Flakes/ja: Difference between revisions
Created page with "[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references Nix flake referencesのマニュアル]." |
No edit summary Tags: Mobile edit Mobile web edit |
||
(3 intermediate revisions by one other user not shown) | |||
Line 11: | Line 11: | ||
* <code>flake.nix</code>ファイルの内容は、Nix言語でパッケージとその依存関係を宣言するための統一された命名スキーマに従っています。 | * <code>flake.nix</code>ファイルの内容は、Nix言語でパッケージとその依存関係を宣言するための統一された命名スキーマに従っています。 | ||
* Flakeは外部のソースを指定するために[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references URLのような構文]を提供しています。 | |||
* | |||
* 長いURL構文を簡易にするために[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-registry.html Flakeはレジストリを使用]して短い記号として登録できます。 | * 長いURL構文を簡易にするために[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-registry.html Flakeはレジストリを使用]して短い記号として登録できます。 | ||
Line 19: | Line 17: | ||
* また、Flakesは参照(Gitのrefsの事)とバージョンを固定することができ、それらをプログラムによって照会したり更新したりすることができます。 | * また、Flakesは参照(Gitのrefsの事)とバージョンを固定することができ、それらをプログラムによって照会したり更新したりすることができます。 | ||
* [https://nixos.org/manual/nix/stable/command-ref/new-cli/nix.html 実験的なコマンドラインインタフェース] | * [https://nixos.org/manual/nix/stable/command-ref/new-cli/nix.html 実験的なコマンドラインインタフェース]はFlakeの参照を受け取りパッケージのビルド、実行やデプロイができます。 | ||
<span id="Enable_flakes_temporarily"></span> | <span id="Enable_flakes_temporarily"></span> | ||
Line 109: | Line 107: | ||
[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references Nix flake referencesのマニュアル]. | [https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references Nix flake referencesのマニュアル]. | ||
inputsアトリビュートはflakeの依存関係を定義します。例えば、システムflakeではシステムをビルドするためにnixpkgsに依存しています。 | |||
Nixpkgsは以下のコードで定義できます: | |||
<code>inputs.nixpkgs.url = "github:NixOS/nixpkgs/<branch name>";</code> | <code>inputs.nixpkgs.url = "github:NixOS/nixpkgs/<branch name>";</code> |