Flakes/ja: Difference between revisions

Created page with "* <code>inputs</code>はflakeの依存関係をアトリビュートセットとして記述したものです。下にスキーマを記述しています。"
Natsukium (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit
 
(8 intermediate revisions by one other user not shown)
Line 11: Line 11:
* <code>flake.nix</code>ファイルの内容は、Nix言語でパッケージとその依存関係を宣言するための統一された命名スキーマに従っています。
* <code>flake.nix</code>ファイルの内容は、Nix言語でパッケージとその依存関係を宣言するための統一された命名スキーマに従っています。


<div lang="en" dir="ltr" class="mw-content-ltr">
Flakeは外部のソースを指定するために[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references URLのような構文]を提供しています。
Flakes introduce a [https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-references URL-like syntax] for specifying remote sources.
</div>


* 長い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 実験的なコマンドラインインタフェース]はFlakeの参照を受け取りパッケージのビルド、実行やべプロ医ができます。
* [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 98: Line 96:
* <code>inputs</code>はflakeの依存関係をアトリビュートセットとして記述したものです。下にスキーマを記述しています。
* <code>inputs</code>はflakeの依存関係をアトリビュートセットとして記述したものです。下にスキーマを記述しています。


<div lang="en" dir="ltr" class="mw-content-ltr">
* <code>outputs</code>はすべてのrealizeされたinputを受け取り、下に記述されたスキーマのようにアトリビュートセットを返す関数です。
* <code>outputs</code> is a function of one argument that takes an attribute set of all the realized inputs, and outputs another attribute set whose schema is described below.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
* <code>nixConfig</code>[https://nixos.org/manual/nix/stable/command-ref/conf-file.html nix.confに使用できる値]を反映しています。これを用いてこのflake特有の設定を反映させることができます。例としてバイナリキャッシュを設定できます。
* <code>nixConfig</code> is an attribute set of values which reflect the [https://nixos.org/manual/nix/stable/command-ref/conf-file.html values given to nix.conf]. This can extend the normal behavior of a user's nix experience by adding flake-specific configuration, such as a binary cache.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Input_schema"></span>
=== Input schema ===
=== Input スキーマ ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-inputs Nixのflake inputsのマニュアル].
[https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#flake-inputs The nix flake inputs manual].
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[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 The nix flake references manual].
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
inputsアトリビュートはflakeの依存関係を定義します。例えば、システムflakeではシステムをビルドするためにnixpkgsに依存しています。
The inputs attribute defines the dependencies of the flake. For example, nixpkgs has to be defined as a dependency for a system flake in order for the system to build properly.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Nixpkgsは以下のコードで定義できます:
Nixpkgs can be defined using the following code:
</div>


<code>inputs.nixpkgs.url = "github:NixOS/nixpkgs/<branch name>";</code>
<code>inputs.nixpkgs.url = "github:NixOS/nixpkgs/<branch name>";</code>