From aaf499a52c2543c19850928a0ec95072d6d60b54 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 19 Apr 2025 21:21:27 +0800 Subject: [PATCH] fix: can't use `nixpkgs.config` and `nixpkgs.pkgs` at the same time, and other renames --- lib/macosSystem.nix | 6 +++++- modules/darwin/nix-core.nix | 6 ------ modules/darwin/system.nix | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/macosSystem.nix b/lib/macosSystem.nix index ad83cebe..976e9464 100644 --- a/lib/macosSystem.nix +++ b/lib/macosSystem.nix @@ -17,7 +17,11 @@ in darwin-modules ++ [ ({lib, ...}: { - nixpkgs.pkgs = import nixpkgs-darwin {inherit system;}; + nixpkgs.pkgs = import nixpkgs-darwin { + inherit system; # refer the `system` parameter form outer scope recursively + # To use chrome, we need to allow the installation of non-free software + config.allowUnfree = true; + }; }) ] ++ ( diff --git a/modules/darwin/nix-core.nix b/modules/darwin/nix-core.nix index f2647450..0ff35ac5 100644 --- a/modules/darwin/nix-core.nix +++ b/modules/darwin/nix-core.nix @@ -12,12 +12,6 @@ # ################################################################################### - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # Auto upgrade the nix-daemon service. - services.nix-daemon.enable = true; - # Disable auto-optimise-store because of this issue: # https://github.com/NixOS/nix/issues/7273 # "error: cannot link '/nix/store/.tmp-link-xxxxx-xxxxx' to '/nix/store/.links/xxxx': File exists" diff --git a/modules/darwin/system.nix b/modules/darwin/system.nix index c6e071fb..cdb9d9a3 100644 --- a/modules/darwin/system.nix +++ b/modules/darwin/system.nix @@ -17,7 +17,7 @@ ################################################################################### { # Add ability to used TouchID for sudo authentication - security.pam.enableSudoTouchIdAuth = true; + security.pam.services.sudo_local.touchIdAuth = true; time.timeZone = "Asia/Shanghai";