mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2024-11-25 01:23:08 +01: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 {
|
||||
# Refer to the `system` parameter from
|
||||
# the outer scope recursively
|
||||
system = system;
|
||||
inherit system;
|
||||
# To use Chrome, we need to allow the
|
||||
# installation of non-free softwares.
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
pkgs-fd40cef8d = import nixpkgs-fd40cef8d {
|
||||
system = system;
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
@ -40,14 +40,14 @@
|
||||
# 这样能有效重用 nixpkgs 实例,避免 nixpkgs 实例泛滥。
|
||||
pkgs-stable = import nixpkgs-stable {
|
||||
# 这里递归引用了外部的 system 属性
|
||||
system = system;
|
||||
inherit system;
|
||||
# 为了拉取 chrome 等软件包,
|
||||
# 这里我们需要允许安装非自由软件
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
pkgs-fd40cef8d = import nixpkgs-fd40cef8d {
|
||||
system = system;
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user