diff --git a/flake.nix b/flake.nix index fb700847..a1c5a9da 100644 --- a/flake.nix +++ b/flake.nix @@ -140,7 +140,7 @@ } // inputs; base_args = { - inherit nix-darwin home-manager system specialArgs; + inherit nix-darwin home-manager system specialArgs nixpkgs; }; in { harmonica = macosSystem (base_args // { diff --git a/lib/macosSystem.nix b/lib/macosSystem.nix index 4161b0e7..927349ff 100644 --- a/lib/macosSystem.nix +++ b/lib/macosSystem.nix @@ -1,4 +1,5 @@ { + nixpkgs, nix-darwin, home-manager, system, @@ -13,6 +14,15 @@ in modules = darwin-modules ++ [ + { + # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. + nix.registry.nixpkgs.flake = nixpkgs; + + # make `nix repl ''` use the same nixpkgs as the one used by this flake. + environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; + nix.nixPath = ["/etc/nix/inputs"]; + } + home-manager.darwinModules.home-manager { home-manager.useGlobalPkgs = true;