From e39b79c5085a3555a754972ca88f5451f82638f4 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 4 Aug 2023 22:40:15 +0800 Subject: [PATCH] feat: use the same nixpkgs as much as possible - macOS --- flake.nix | 2 +- lib/macosSystem.nix | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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;