From 325f82b9cc626c7f2aec29531f4e74ee411841b9 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Wed, 31 Jul 2024 13:39:49 +0800 Subject: [PATCH] fix: nix path (#147) --- modules/base.nix | 10 ++++++++++ modules/darwin/nix-core.nix | 12 ------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/base.nix b/modules/base.nix index 56b197d7..be45478f 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -2,6 +2,8 @@ pkgs, myvars, nuenv, + nixpkgs, + lib, ... } @ args: { nixpkgs.overlays = @@ -111,4 +113,12 @@ ]; builders-use-substitutes = true; }; + + # 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 3d795ea6..e278e648 100644 --- a/modules/darwin/nix-core.nix +++ b/modules/darwin/nix-core.nix @@ -1,8 +1,4 @@ { - lib, - nixpkgs, - ... -}: { ################################################################################### # # Core configuration for nix-darwin @@ -28,12 +24,4 @@ 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"]; }