diff --git a/flake.nix b/flake.nix index 46e8d94..5f01a80 100644 --- a/flake.nix +++ b/flake.nix @@ -23,11 +23,20 @@ forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; in { lib = nixpkgs.lib.extend (final: prev: { - nixosSystem = (args: prev.nixosSystem { - modules = args.modules ++ [ - ({ ... }: { nixpkgs.overlays = overlays; }) - ]; - } // builtins.removeAttrs args [ "modules" ]); + nixosSystem = args: + import "${nixpkgs}/nixos/lib/eval-config.nix" ( + { + lib = final; + + system = null; + + modules = args.modules ++ [ + ({ config, pkgs, lib, ... }: { + config.nixpkgs.flake.source = self.outPath; + }) + ]; + } // builtins.removeAttrs args [ "modules" ] + ); }); legacyPackages = forAllSystems (system: