feat: migrated mac config to separate file
This commit is contained in:
@@ -16,94 +16,12 @@
|
|||||||
}: let
|
}: let
|
||||||
systems = ["x86_64-linux" "aarch64-darwin"];
|
systems = ["x86_64-linux" "aarch64-darwin"];
|
||||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
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 {
|
in {
|
||||||
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||||
# Build darwin flake using:
|
|
||||||
# $ darwin-rebuild build --flake .#simple
|
|
||||||
darwinConfigurations."MacBook-Pro-Kirill" = nix-darwin.lib.darwinSystem {
|
darwinConfigurations."MacBook-Pro-Kirill" = nix-darwin.lib.darwinSystem {
|
||||||
modules = [
|
modules = [
|
||||||
configuration
|
./hosts/MacBook-Pro-Kirill/configuration.nix
|
||||||
inputs.spicetify-nix.darwinModules.default
|
inputs.spicetify-nix.darwinModules.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user