From f747eb1ecde9a37acc6326416d93e6452b926376 Mon Sep 17 00:00:00 2001 From: Zeusina Date: Sun, 5 Jul 2026 11:52:48 +0300 Subject: [PATCH] feat: migrated mac config to separate file --- flake.nix | 86 +--------------------- hosts/MacBook-Pro-Kirill/configuration.nix | 71 ++++++++++++++++++ 2 files changed, 73 insertions(+), 84 deletions(-) create mode 100644 hosts/MacBook-Pro-Kirill/configuration.nix diff --git a/flake.nix b/flake.nix index 3256fe9..9c051bc 100644 --- a/flake.nix +++ b/flake.nix @@ -16,94 +16,12 @@ }: let systems = ["x86_64-linux" "aarch64-darwin"]; forAllSystems = nixpkgs.lib.genAttrs systems; - configuration = {pkgs, ...}: { - # List packages installed in system profile. To search by name, run: - # $ nix-env -qaP | grep wget - environment.systemPackages = [ - pkgs.starship - pkgs.zoxide - pkgs.fzf - pkgs.fastfetch - pkgs.htop - pkgs.btop - pkgs.eza - pkgs.git - ]; - - homebrew = { - enable = true; - onActivation = { - # Автоматически обновлять Homebrew и формулы - autoUpdate = true; - upgrade = true; - - # САМАЯ ВАЖНАЯ ОПЦИЯ ДЛЯ ВАШЕЙ ЗАДАЧИ: - # "uninstall" - удаляет пакеты (brews) и приложения (casks), которых нет в конфиге. - # "zap" - делает то же самое, но дополнительно подчищает хвосты (файлы настроек) от Casks. - cleanup = "zap"; - }; - - casks = [ - "nextcloud" - "google-chrome" - "bitwarden" - "localsend" - # "tor-browser" - "iterm2" - # "spotify" - "qbittorrent" - "obsidian" - "visual-studio-code" - "ayugram" - "equinox" - ]; - }; - - nix.gc = { - automatic = true; - # Запускать в воскресенье (Weekday = 0) в 2:00 ночи - interval = { - Weekday = 0; - Hour = 2; - Minute = 0; - }; - options = "--delete-older-than 7d"; - }; - - nix.optimise.automatic = true; - - programs.spicetify = let - spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; - in { - enable = true; - enabledExtensions = with spicePkgs.extensions; [ - adblock - beautiful-lyrics - ]; - }; - - # Necessary for using flakes on this system. - nix.settings.experimental-features = "nix-command flakes"; - system.primaryUser = "kirill"; - - # Set Git commit hash for darwin-version. - system.configurationRevision = self.rev or self.dirtyRev or null; - - # Used for backwards compatibility, please read the changelog before changing. - # $ darwin-rebuild changelog - system.stateVersion = 6; - - # The platform the configuration will be used on. - nixpkgs.hostPlatform = "aarch64-darwin"; - nixpkgs.config.allowUnfree = true; - }; in { formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); - # Build darwin flake using: - # $ darwin-rebuild build --flake .#simple + darwinConfigurations."MacBook-Pro-Kirill" = nix-darwin.lib.darwinSystem { modules = [ - configuration + ./hosts/MacBook-Pro-Kirill/configuration.nix inputs.spicetify-nix.darwinModules.default ]; }; diff --git a/hosts/MacBook-Pro-Kirill/configuration.nix b/hosts/MacBook-Pro-Kirill/configuration.nix new file mode 100644 index 0000000..6a02a71 --- /dev/null +++ b/hosts/MacBook-Pro-Kirill/configuration.nix @@ -0,0 +1,71 @@ +# configuration.nix +{ + pkgs, + inputs, + self, + ... +}: { + environment.systemPackages = [ + pkgs.starship + pkgs.zoxide + pkgs.fzf + pkgs.fastfetch + pkgs.htop + pkgs.btop + pkgs.eza + pkgs.git + ]; + + homebrew = { + enable = true; + onActivation = { + autoUpdate = true; + upgrade = true; + cleanup = "zap"; + }; + + casks = [ + "nextcloud" + "google-chrome" + "bitwarden" + "localsend" + "iterm2" + "qbittorrent" + "obsidian" + "visual-studio-code" + "ayugram" + "equinox" + ]; + }; + + nix.gc = { + automatic = true; + interval = { + Weekday = 0; + Hour = 2; + Minute = 0; + }; + options = "--delete-older-than 7d"; + }; + + nix.optimise.automatic = true; + + programs.spicetify = let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; + in { + enable = true; + enabledExtensions = with spicePkgs.extensions; [ + adblock + beautiful-lyrics + ]; + }; + + nix.settings.experimental-features = "nix-command flakes"; + system.primaryUser = "kirill"; + + system.configurationRevision = self.rev or self.dirtyRev or null; + system.stateVersion = 6; + + nixpkgs.hostPlatform = "aarch64-darwin"; + nixpkgs.config.allowUnfree = true; +}