Files
bankrupt/home-manager/darwin.nix
T
2025-11-15 23:17:12 +08:00

55 lines
1.3 KiB
Nix

# macOS-specific home-manager configuration
{
inputs,
lib,
config,
pkgs,
...
}: lib.mkIf pkgs.stdenv.isDarwin {
# macOS-specific packages
home.packages = with pkgs; [
# macOS CLI tools
# m-cli # Swiss Army Knife for macOS
# GUI applications (if you want to manage them with nix)
# Note: Many prefer to use homebrew for GUI apps on macOS
];
# macOS-specific configurations
home.sessionVariables = {
# Fix for Nix on macOS
NIX_PATH = "nixpkgs=${inputs.nixpkgs}:darwin=${inputs.darwin}";
};
# Fish shell configuration for macOS
programs.fish = lib.mkIf config.programs.fish.enable {
shellInit = ''
# Add Homebrew to PATH if it exists
if test -d /opt/homebrew/bin
fish_add_path /opt/homebrew/bin
end
'';
};
# Zsh configuration for macOS
programs.zsh = lib.mkIf config.programs.zsh.enable {
initExtra = ''
# Add Homebrew to PATH if it exists
if [[ -d /opt/homebrew/bin ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
'';
};
# Bash configuration for macOS
programs.bash = lib.mkIf config.programs.bash.enable {
initExtra = ''
# Add Homebrew to PATH if it exists
if [[ -d /opt/homebrew/bin ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
'';
};
}