From db6dd6076ea56a9821de2120f86455039b51b977 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sat, 30 Aug 2025 17:36:51 +0200 Subject: [PATCH] Further file arrangement --- flake.nix | 31 ------------------------------- modules/nvim.nix | 14 ++++++++------ system/darwin/default.nix | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index 24157b4..e011332 100644 --- a/flake.nix +++ b/flake.nix @@ -18,39 +18,9 @@ }; outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, nixvim, claude-code, firefox-addons, nix-homebrew }: - let - # Common system configuration shared across all Darwin systems - commonSystemConfig = { pkgs, ... }: { - imports = [ - ./modules/tailscale.nix - ]; - - environment.systemPackages = [ - # System-level packages only - ]; - - nix.settings.experimental-features = "nix-command flakes"; - nix.settings.substituters = [ - "https://cache.nixos.org/" - "https://nix-community.cachix.org" - "https://devenv.cachix.org" - ]; - nix.settings.trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" - ]; - system.stateVersion = 6; - nixpkgs.hostPlatform = "aarch64-darwin"; - - programs.zsh.enable = true; - }; - - in { darwinConfigurations."iMac" = nix-darwin.lib.darwinSystem { modules = [ - commonSystemConfig ./hosts/darwin/iMac ]; specialArgs = { inherit nix-homebrew; }; @@ -58,7 +28,6 @@ darwinConfigurations."MacBook-Air" = nix-darwin.lib.darwinSystem { modules = [ - commonSystemConfig ./hosts/darwin/MacBook-Air ]; specialArgs = { inherit nix-homebrew; }; diff --git a/modules/nvim.nix b/modules/nvim.nix index e1b964c..a16f065 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -242,12 +242,14 @@ }, }) - -- Dictionary completion setup - require("cmp_dictionary").setup({ - paths = { "/usr/share/dict/words" }, -- Standard dictionary path - exact_length = 2, -- Minimum length before completion - first_case_insensitive = true, -- Case insensitive matching - }) + -- Dictionary completion setup (macOS only) + ${lib.optionalString pkgs.stdenv.isDarwin '' + require("cmp_dictionary").setup({ + paths = { "/usr/share/dict/words" }, -- Standard dictionary path on macOS + exact_length = 2, -- Minimum length before completion + first_case_insensitive = true, -- Case insensitive matching + }) + ''} -- Telescope setup for better file finding local telescope = require('telescope') diff --git a/system/darwin/default.nix b/system/darwin/default.nix index bf92dcc..862ecf4 100644 --- a/system/darwin/default.nix +++ b/system/darwin/default.nix @@ -4,8 +4,27 @@ imports = [ ../../modules/homebrew.nix nix-homebrew.darwinModules.nix-homebrew + ../../modules/tailscale.nix ]; + # Nix configuration + nix.settings.experimental-features = "nix-command flakes"; + nix.settings.substituters = [ + "https://cache.nixos.org/" + "https://nix-community.cachix.org" + "https://devenv.cachix.org" + ]; + nix.settings.trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" + ]; + + # System configuration + system.stateVersion = 6; + nixpkgs.hostPlatform = "aarch64-darwin"; + programs.zsh.enable = true; + # Set primary user for system preferences system.primaryUser = "yanlin";