This commit is contained in:
2025-12-26 11:02:58 +01:00
commit 83841223bb
15 changed files with 922 additions and 0 deletions

63
darwin/default.nix Normal file
View File

@@ -0,0 +1,63 @@
{
pkgs,
inputs,
self,
primaryUser,
...
}:
{
imports = [
# ./homebrew.nix
./settings.nix
inputs.home-manager.darwinModules.home-manager
inputs.nix-homebrew.darwinModules.nix-homebrew
];
# nix config
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
# disabled due to https://github.com/NixOS/nix/issues/7273
# auto-optimise-store = true;
};
enable = false; # using determinate installer
};
nixpkgs.config.allowUnfree = true;
# homebrew installation manager
nix-homebrew = {
user = primaryUser;
enable = true;
autoMigrate = true;
};
# home-manager config
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${primaryUser} = {
imports = [
../home
];
};
extraSpecialArgs = {
inherit inputs self primaryUser;
};
};
# macOS-specific settings
system.primaryUser = primaryUser;
users.users.${primaryUser} = {
home = "/Users/${primaryUser}";
shell = pkgs.zsh;
};
environment = {
systemPath = [
"/opt/homebrew/bin"
];
pathsToLink = [ "/Applications" ];
};
}

54
darwin/homebrew.nix Normal file
View File

@@ -0,0 +1,54 @@
{ ... }:
{
homebrew = {
enable = true;
onActivation = {
autoUpdate = false;
upgrade = true;
cleanup = "zap";
};
caskArgs.no_quarantine = true;
global.brewfile = true;
# homebrew is best for GUI apps
# nixpkgs is best for CLI tools
casks = [
# OS enhancements
"aerospace"
"cleanshot"
"hiddenbar"
"raycast"
"betterdisplay"
# dev
"cursor"
"ghostty"
"visual-studio-code"
"zed"
# messaging
"discord"
"slack"
"signal"
# other
"1password"
"anki"
"brave-browser"
"obsidian"
"protonvpn"
"spotify"
"thebrowsercompany-dia"
"zen"
];
brews = [
"docker"
"colima"
];
taps = [
"nikitabobko/tap"
];
};
}

35
darwin/settings.nix Normal file
View File

@@ -0,0 +1,35 @@
{ self, ... }:
{
# touch ID for sudo
security.pam.services.sudo_local.touchIdAuth = true;
# system defaults and preferences
system = {
stateVersion = 6;
configurationRevision = self.rev or self.dirtyRev or null;
startup.chime = false;
defaults = {
loginwindow = {
GuestEnabled = false;
DisableConsoleAccess = true;
};
finder = {
AppleShowAllFiles = true; # hidden files
AppleShowAllExtensions = true; # file extensions
_FXShowPosixPathInTitle = true; # title bar full path
ShowPathbar = true; # breadcrumb nav at bottom
ShowStatusBar = true; # file count & disk space
};
NSGlobalDomain = {
NSAutomaticSpellingCorrectionEnabled = false;
NSAutomaticCapitalizationEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticWindowAnimationsEnabled = false;
};
};
};
}