mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2025-06-25 06:21:40 +02:00
polish: use inherit
This commit is contained in:
parent
dfc73a8667
commit
6d986d75c4
@ -39,13 +39,13 @@ Here's an example of how you can add multiple nixpkgs inputs, each using a diffe
|
|||||||
pkgs-stable = import nixpkgs-stable {
|
pkgs-stable = import nixpkgs-stable {
|
||||||
# Refer to the `system` parameter from
|
# Refer to the `system` parameter from
|
||||||
# the outer scope recursively
|
# the outer scope recursively
|
||||||
system = system;
|
inherit system;
|
||||||
# To use Chrome, we need to allow the
|
# To use Chrome, we need to allow the
|
||||||
# installation of non-free softwares.
|
# installation of non-free softwares.
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
pkgs-fd40cef8d = import nixpkgs-fd40cef8d {
|
pkgs-fd40cef8d = import nixpkgs-fd40cef8d {
|
||||||
system = system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -40,14 +40,14 @@
|
|||||||
# 这样能有效重用 nixpkgs 实例,避免 nixpkgs 实例泛滥。
|
# 这样能有效重用 nixpkgs 实例,避免 nixpkgs 实例泛滥。
|
||||||
pkgs-stable = import nixpkgs-stable {
|
pkgs-stable = import nixpkgs-stable {
|
||||||
# 这里递归引用了外部的 system 属性
|
# 这里递归引用了外部的 system 属性
|
||||||
system = system;
|
inherit system;
|
||||||
# 为了拉取 chrome 等软件包,
|
# 为了拉取 chrome 等软件包,
|
||||||
# 这里我们需要允许安装非自由软件
|
# 这里我们需要允许安装非自由软件
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
pkgs-fd40cef8d = import nixpkgs-fd40cef8d {
|
pkgs-fd40cef8d = import nixpkgs-fd40cef8d {
|
||||||
system = system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user