Skip to content

Commit

Permalink
feat: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Feb 7, 2024
1 parent 4095216 commit 52ba377
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/other-usage-of-flakes/module-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ The most typical usage is to, within the same Nixpkgs module, set values for oth
It's easier to understand with a direct example:

```nix
# ./foo.nix
{ config, lib, pkgs, ... }:
with lib;
Expand Down Expand Up @@ -139,6 +140,7 @@ Then, in the `config` section, based on the values declared in these three varia
This way, we can import this module in another Nix file and achieve custom configuration for `foo` by setting the `options` defined here. For example:

```nix
# ./bar.nix
{ config, lib, pkgs, ... }:
{
Expand All @@ -165,6 +167,7 @@ The module system takes full advantage of Nix's lazy evaluation feature, which i
Let's start with a simple example:

```nix
# ./flake.nix
{
description = "NixOS Flake for Test";
Expand Down
3 changes: 3 additions & 0 deletions docs/zh/other-usage-of-flakes/module-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Nixpkgs 中定义的模块,其基本结构如下:
直接看个例子更容易理解:

```nix
# ./foo.nix
{ config, lib, pkgs, ... }:
with lib;
Expand Down Expand Up @@ -146,6 +147,7 @@ in {
这样,我们就可以在另一个 nix 文件中导入这个模块,并通过设置这里定义的 `options` 来实现对 foo 的自定义配置了,示例:

```nix
# ./bar.nix
{ config, lib, pkgs, ... }:
{
Expand All @@ -172,6 +174,7 @@ in {
先看个简单的例子:

```nix
# ./flake.nix
{
description = "NixOS Flake for Test";
Expand Down

0 comments on commit 52ba377

Please sign in to comment.