dotfiles/nixos/hosts/macos.nix
Daniel Thoren 948798af4a
fix(darwin): migrate to new nix-darwin options & root activation 🔧
- set `nix.enable = true`; remove deprecated `services.nix-daemon.enable` 🔥
- replace unsafe `nix.settings.auto-optimise-store` with `nix.optimise.automatic`
- rename Touch ID option to `security.pam.services.sudo_local.touchIdAuth`
- add `system.primaryUser = "danny"` so user-scoped macOS defaults apply under root activation
- keep GC schedule; retain `nixpkgs.hostPlatform = "aarch64-darwin"`
- (minor) expand `environment.systemPackages` with `git`, `gnupg`, `coreutils`

This adapts the config to recent nix-darwin changes and fixes evaluation failures during `darwin-rebuild`.
2025-09-08 14:52:14 +02:00

82 lines
1.7 KiB
Nix

{ config, lib, pkgs, ... }:
{
# Apple Silicon + nix-darwin basics
nixpkgs.hostPlatform = "aarch64-darwin";
nix.enable = true;
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
};
gc = {
automatic = true;
interval = { Weekday = 0; Hour = 3; Minute = 0; };
};
optimise.automatic = true; # replaces auto-optimise-store
};
nixpkgs.config.allowUnfree = true;
system.primaryUser = "danny";
# Shells & dev ergonomics
programs.fish.enable = true;
environment.shells = [ pkgs.fish ];
# If you want fish as default shell, uncomment:
# users.defaultUserShell = pkgs.fish;
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
# Networking (macOS-safe)
networking = {
# Set if you want a specific hostname in macOS UI as well:
hostName = "Daniel-Macbook-Air";
knownNetworkServices = [ "Wi-Fi" "Thunderbolt Bridge" ];
};
# macOS niceties
security.pam.services.sudo_local.touchIdAuth = true;
system.defaults = {
# Keyboard
NSGlobalDomain = {
ApplePressAndHoldEnabled = false;
InitialKeyRepeat = 15;
KeyRepeat = 2;
};
# Finder & Dock
finder.AppleShowAllExtensions = true;
dock.autohide = true;
dock.mru-spaces = false;
};
# Environment
environment.variables = {
DBT_USER = "DNTH";
};
environment.systemPackages = with pkgs; [
gh
ripgrep
wget
busybox
git
gnupg
coreutils
openssl
neofetch
btop
tldr
fzf
cowsay
lolcat
];
# Keep for darwin as well (tracks defaults across upgrades)
# current max per nix-darwin; bump only if a release notes says so
system.stateVersion = 6;
}