Skip to content

Instantly share code, notes, and snippets.

@treboc
Created February 9, 2026 17:20
Show Gist options
  • Select an option

  • Save treboc/ccea4682048fdcae6f3ca3c8e671cd40 to your computer and use it in GitHub Desktop.

Select an option

Save treboc/ccea4682048fdcae6f3ca3c8e671cd40 to your computer and use it in GitHub Desktop.
{
description = "Trebocs Darwin System Flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew";
# Optional: Declarative tap management
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
};
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, homebrew-core, homebrew-cask }:
let
username = "treboc";
configuration = { pkgs, config, ... }: {
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[
pkgs.bat
pkgs.chezmoi
pkgs.cloc
pkgs.colima
pkgs.criterion
pkgs.direnv
pkgs.delta
pkgs.eza
pkgs.fish
pkgs.fzf
pkgs.gh
pkgs.go
pkgs.httpie
pkgs.magic-wormhole
pkgs.lazygit
pkgs.lf
pkgs.neovim
pkgs.helix
pkgs.helix-gpt
pkgs.neofetch
pkgs.nixpkgs-fmt
pkgs.obsidian
pkgs.tmux
pkgs.tree
pkgs.slack
pkgs.starship
pkgs.xcbeautify
pkgs.yazi
];
system.primaryUser = username;
homebrew = {
enable = true;
taps = [
{
name = "FelixKratz/formulae";
}
];
brews = [
"jq"
"luarocks"
"mas"
"mysql"
"ripgrep"
"swiftlint"
"spotify_player"
"sketchybar"
"borders"
"go-task"
];
casks = [
"1password"
"1password-cli"
"nikitabobko/tap/aerospace"
"alfred"
"android-studio"
"anki"
"appcleaner"
"arc"
"azure-data-studio"
"bruno"
"caffeine"
"copilot-for-xcode"
"daisydisk"
"discord"
"docker"
"firefox"
"font-iosevka-nerd-font"
"font-iosevka-term-nerd-font"
"fork"
"ghostty"
"hot"
"karabiner-elements"
"netnewswire"
"ngrok"
"no-ip-duc"
"orbstack"
"pgadmin4"
"sf-symbols"
"spotify"
"visual-studio-code"
"whatsapp"
"xcodes"
"zed"
"steam"
# used for sketchybar
"font-hack-nerd-font"
"font-sf-pro"
"font-sketchybar-app-font"
"signal"
];
masApps = {
"Dev Cleaner" = 1388020431;
"Flow" = 1423210932;
"Gifski" = 1351639930;
"Tiny Lorem" = 1640855061;
};
onActivation.cleanup = "zap";
onActivation.autoUpdate = true;
onActivation.upgrade = true;
};
system.defaults = {
dock.autohide = true;
dock.autohide-delay = 0.001;
dock.autohide-time-modifier = 0.001;
dock.expose-animation-duration = 0.1;
dock.persistent-apps = [
"/Applications/Arc.app"
"/Applications/Ghostty.app"
"/Applications/Xcode-26.0.0-Beta.2.app"
"/System/Applications/Notes.app"
"/Applications/NetNewsWire.app"
"/System/Applications/Messages.app"
"/Applications/Signal.app"
"/Applications/Discord.app"
"/Applications/Spotify.app"
];
finder.AppleShowAllExtensions = true;
finder.AppleShowAllFiles = true;
finder.FXPreferredViewStyle = "clmv";
loginwindow.GuestEnabled = false;
NSGlobalDomain.AppleInterfaceStyle = "Dark";
NSGlobalDomain.KeyRepeat = 1;
NSGlobalDomain.InitialKeyRepeat = 10;
};
# Auto upgrade nix package and the daemon service.
nix.enable = true;
ids.gids.nixbld = 30000;
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true;
programs.fish.enable = true;
# 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 = 5;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
# Enable sudo touch id authentication.
security.pam.services.sudo_local.touchIdAuth = true;
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#simple
darwinConfigurations."l0calhost" = nix-darwin.lib.darwinSystem {
modules = [
configuration
nix-homebrew.darwinModules.nix-homebrew
{
nix-homebrew = {
enable = true;
enableRosetta = true;
user = "treboc";
autoMigrate = true;
};
}
];
};
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."l0calhost".pkgs;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment