From 7d99fab205da2cd9dae6f3d98eaa35d0efe27bdc Mon Sep 17 00:00:00 2001 From: ryan4yin Date: Thu, 1 Jun 2023 16:32:10 +0800 Subject: [PATCH] fix: create nixpkgs instance only in flake.nix, do not create it in any sub module or overlays --- flake.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index d9064c8a..cb78eecc 100644 --- a/flake.nix +++ b/flake.nix @@ -117,13 +117,12 @@ # Only these four parameters can be passed by default. # If you need to pass other parameters, you must use `specialArgs` by uncomment the following line specialArgs = { - inherit inputs; pkgs-stable = import inputs.nixpkgs-stable { system = system; # refer the `system` parameter form outer scope recursively # To use chrome, we need to allow the installation of non-free software config.allowUnfree = true; }; - }; + } // inputs; modules = [ ./hosts/msi-rtx4090 @@ -141,9 +140,14 @@ ]; }; - nixos-test = nixpkgs.lib.nixosSystem { + nixos-test = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; - specialArgs = inputs; + specialArgs = { + pkgs-stable = import inputs.nixpkgs-stable { + system = system; + config.allowUnfree = true; + }; + } // inputs; modules = [ ./hosts/nixos-test