nix-dots/machines/mac/configuration.nix

111 lines
2.1 KiB
Nix

{
config,
pkgs,
...
}: {
users.users.michael = {
home = "/Users/michael";
shell = pkgs.zsh;
};
networking = {
computerName = "neptune";
hostName = "neptune";
};
environment = {
shells = with pkgs; [zsh];
variables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
systemPackages = with pkgs; [
# Terminal
git
# Containers
colima
docker-client
docker-compose
# Video
ffmpeg
# Spotify
unstable.spicetify-cli
# Java
checkstyle
];
};
programs = {
zsh = {
enable = true;
# Make zsh installation work properly with macOS path
loginShellInit = ''
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
'';
};
};
security.pam.enableSudoTouchIdAuth = true;
services = {
nix-daemon.enable = true;
};
homebrew = {
enable = true;
onActivation = {
# Auto update packages
autoUpdate = true;
# Uninstall not listed packages and casks
cleanup = "zap";
# Upgrade outdated formulae on activation
upgrade = true;
};
taps = [
"ddev/ddev"
"homebrew/cask-fonts"
];
brews = [
"cocoapods"
"openjdk@17"
"bash" # Required for nix-shell to function properly
"ddev/ddev/ddev"
"firefoxpwa"
];
casks = [
"hiddenbar"
"android-platform-tools"
"mactex"
"font-caskaydia-cove-nerd-font"
"gcenx/wine/wineskin"
];
};
nixpkgs = {
# Workaround for pyopenssl being marked broken
config.allowBroken = true;
};
nix = {
package = pkgs.nix;
gc = {
automatic = true;
interval.Day = 7;
options = "--delete-older-than 7d";
};
extraOptions = ''
auto-optimise-store = true
experimental-features = nix-command flakes
'';
settings.auto-optimise-store = false;
};
system = {
# Since it's not possible to declare default shell, run this command after build
activationScripts.postActivation.text = ''sudo chsh -s ${pkgs.zsh}/bin/zsh'';
stateVersion = 4;
};
}