From 6d986d75c4cf066bc5e238fcfa994a56587cec72 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 16 Mar 2024 12:56:21 +0800 Subject: [PATCH] polish: use inherit --- docs/nixos-with-flakes/downgrade-or-upgrade-packages.md | 4 ++-- docs/zh/nixos-with-flakes/downgrade-or-upgrade-packages.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/nixos-with-flakes/downgrade-or-upgrade-packages.md b/docs/nixos-with-flakes/downgrade-or-upgrade-packages.md index 15c66ac..9028f18 100644 --- a/docs/nixos-with-flakes/downgrade-or-upgrade-packages.md +++ b/docs/nixos-with-flakes/downgrade-or-upgrade-packages.md @@ -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; }; }; diff --git a/docs/zh/nixos-with-flakes/downgrade-or-upgrade-packages.md b/docs/zh/nixos-with-flakes/downgrade-or-upgrade-packages.md index 00986df..a3d8d17 100644 --- a/docs/zh/nixos-with-flakes/downgrade-or-upgrade-packages.md +++ b/docs/zh/nixos-with-flakes/downgrade-or-upgrade-packages.md @@ -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; }; };