112 lines
3.2 KiB
Nix
112 lines
3.2 KiB
Nix
{
|
|
description = "Example nix-darwin system flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
nix-darwin.url = "github:nix-darwin/nix-darwin/master";
|
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
spicetify-nix.url = "github:Gerg-L/spicetify-nix";
|
|
};
|
|
|
|
outputs = inputs @ {
|
|
self,
|
|
nix-darwin,
|
|
nixpkgs,
|
|
spicetify-nix,
|
|
}: 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
|
|
inputs.spicetify-nix.darwinModules.default
|
|
];
|
|
};
|
|
};
|
|
}
|