From 6b016a243217586b7524c68d4b14c3719f62fa1b Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 20 Apr 2024 14:02:56 +0800 Subject: [PATCH] refactor: macos's nixpkgs registry --- lib/macosSystem.nix | 7 ------- modules/darwin/nix-core.nix | 14 +++++++++++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/macosSystem.nix b/lib/macosSystem.nix index 2fd90454..e69cb415 100644 --- a/lib/macosSystem.nix +++ b/lib/macosSystem.nix @@ -18,13 +18,6 @@ in ++ [ ({lib, ...}: { nixpkgs.pkgs = import nixpkgs {inherit system;}; - # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. - nix.registry.nixpkgs.flake = nixpkgs; - - environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; - # make `nix repl ''` use the same nixpkgs as the one used by this flake. - # discard all the default paths, and only use the one from this flake. - nix.nixPath = lib.mkForce ["/etc/nix/inputs"]; }) ] ++ ( diff --git a/modules/darwin/nix-core.nix b/modules/darwin/nix-core.nix index 992be3a0..3d795ea6 100644 --- a/modules/darwin/nix-core.nix +++ b/modules/darwin/nix-core.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + lib, + nixpkgs, + ... +}: { ################################################################################### # # Core configuration for nix-darwin @@ -24,4 +28,12 @@ nix.settings.auto-optimise-store = false; nix.gc.automatic = false; + + # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. + nix.registry.nixpkgs.flake = nixpkgs; + + environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; + # make `nix repl ''` use the same nixpkgs as the one used by this flake. + # discard all the default paths, and only use the one from this flake. + nix.nixPath = lib.mkForce ["/etc/nix/inputs"]; }