refactor: macos's nixpkgs registry

This commit is contained in:
Ryan Yin
2024-04-20 14:02:56 +08:00
parent cad8cf325d
commit 6b016a2432
2 changed files with 13 additions and 8 deletions

View File

@@ -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 '<nixpkgs>'` 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"];
})
]
++ (

View File

@@ -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 '<nixpkgs>'` 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"];
}