I get this error when I pkgs = import nixpkgs { overlays = [ /* .. */ ]; };' and then
specialArgs = { inherit pkgs; /* … */ }`
evaluation warning: You have set specialArgs.pkgs, which means that options like nixpkgs.config
and nixpkgs.overlays will be ignored. If you wish to reuse an already created
pkgs, which you know is configured correctly for this NixOS configuration,
please import the `nixosModules.readOnlyPkgs` module from the nixpkgs flake or
`(modulesPath + "/misc/nixpkgs/read-only.nix"), and set `{ nixpkgs.pkgs = <your pkgs>; }`.
This properly disables the ignored options to prevent future surprises.
I tried every iteration of things suggested in the error message, and noticed that the error remains in all cases where I continue to provide the pkgs
argument. However, once I remove the pkgs argument to specialArgs
, I no longer error, even if I am passing readOnlyPkgs module to nixpkgs.lib.nixosSystem.modules
Whats the right way to pass a pre-instantiated nixpkgs to nixos? Because I am skill issuing hard.