chezmoi: macOS

This commit is contained in:
whoami 2025-09-27 16:00:34 +01:00
parent fff9275372
commit c1a63e4658
39 changed files with 10 additions and 284 deletions

3
.gitignore vendored
View file

@ -7,9 +7,6 @@ dot_config/fish/completions
dot_config/fish/functions/br.fish dot_config/fish/functions/br.fish
dot_config/fish/functions/dotenv.fish dot_config/fish/functions/dotenv.fish
# Private Files
*private*
.private.env.*
# Test files # Test files
test/ test/

View file

@ -15,13 +15,21 @@ scripts
.config/waybar .config/waybar
.config/wlogout .config/wlogout
.config/krunnerrc .config/krunnerrc
.config/systemd
.config/user-dirs.dirs .config/user-dirs.dirs
.config/user-dirs.locale .config/user-dirs.locale
{{ end }} {{ end }}
{{ if eq .chezmoi.os "linux" }}
{{ if ne .chezmoi.osRelease.id "arch" }} {{ if ne .chezmoi.osRelease.id "arch" }}
.config/*-flags.conf .config/*-flags.conf
{{ end }} {{ end }}
{{ end }}
{{ if ne .chezmoi.os "darwin" }}
Library
.config/karabiner
.config/sketchybar
.config/skhd
.config/yabai
{{ end}}

View file

@ -1,113 +0,0 @@
# vim:shiftwidth=2
# https://github.com/LnL7/nix-darwin/tree/5d6e0851b60508cffd66b4a6982440a40720338d/modules/system/defaults
{ pkgs, ... }: {
system.defaults = {
dock = {
appswitcher-all-displays = true;
autohide = true;
# Launch Animation
launchanim = false;
# Minimize Animation
mineffect = "suck";
minimize-to-application = true;
persistent-apps = [
{ app = "/Applications/Vivaldi.app"; }
{ app = "/Applications/WezTerm.app"; }
{ app = "/Applications/Obsidian.app"; }
{ app = "/Applications/Visual Studio Code.app"; }
{ app = "/Applications/Neovide.app"; }
# { spacer = { small = false; }; }
# { spacer = { small = true; }; }
# { folder = "/System/Applications/Utilities"; }
# { folder = "/Users/js0ny/Downloads/"; }
];
persistent-others = [
"/Users/js0ny/Downloads"
"/Users/js0ny/Source"
];
show-recents = false;
orientation = "bottom";
# tr - Top Right
# tl - Top Left (disable this)
# br - Bottom Right
# bl - Bottom Left
# `1`: Disabled
# `2`: Mission Control
# `3`: Application Windows
# `4`: Desktop
# `5`: Start Screen Saver
# `6`: Disable Screen Saver
# `7`: Dashboard
# `10`: Put Display to Sleep
# `11`: Launchpad
# `12`: Notification Center
# `13`: Lock Screen
# `14`: Quick Note
wvous-tr-corner = 2;
wvous-bl-corner = 11; # Simulate Windows button on Windows
wvous-br-corner = 4;
};
finder = {
AppleShowAllFiles = true;
ShowStatusBar = true;
ShowPathbar = true;
FXRemoveOldTrashItems = true;
AppleShowAllExtensions = true;
QuitMenuItem = true;
ShowExternalHardDrivesOnDesktop = false;
ShowRemovableMediaOnDesktop = false;
# This will look show full path in title bar
# For example: /Users/username/Downloads
# instead of just Downloads
_FXShowPosixPathInTitle = false;
_FXSortFoldersFirst = true;
FXEnableExtensionChangeWarning = false;
# Use `Home` instead of `PfHm`
# nix-darwin won't parse `PfHm`
NewWindowTarget = "Home";
};
trackpad = {
TrackpadRightClick = true;
TrackpadThreeFingerDrag = true;
};
screencapture = {
location = "~/Pictures/Screenshots";
type = "png";
include-date = true;
};
SoftwareUpdate.AutomaticallyInstallMacOSUpdates = false;
".GlobalPreferences" = {
"com.apple.sound.beep.sound" = "/System/Library/Sounds/Blow.aiff";
};
NSGlobalDomain = {
AppleInterfaceStyle = "Dark";
AppleInterfaceStyleSwitchesAutomatically = true;
AppleShowAllExtensions = true;
# Use Fn key as standard function keys instead of media keys
"com.apple.keyboard.fnState" = true;
AppleMeasurementUnits = "Centimeters";
AppleICUForce24HourTime = true;
};
controlcenter.BatteryShowPercentage = true;
# Fn usage:
# 0: Show Emoji & Symbols
# 1: Change Input Source
# 2: Show Emoji & Symbols
# 3: Start Dictation
hitoolbox.AppleFnUsageType = "Change Input Source";
WindowManager = {
EnableTilingByEdgeDrag = true;
EnableTopTilingByEdgeDrag = true;
EnableTilingOptionAccelerator = true;
EnableTiledWindowMargins = true;
};
# universalaccess = {
# mouseDriverCursorSize = 1.5;
# reduceMotion = true;
# reduceTransparency = false;
# };
menuExtraClock = {
ShowSeconds = true;
};
};
}

View file

@ -1,52 +0,0 @@
{
description = "Example nix-darwin system flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nix-darwin, nixpkgs }:
let
configuration = { pkgs, ... }: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[ pkgs.vim
];
environment.etc."zshenv".text = ''
if [ -d $HOME/.config/zsh ]; then
export ZDOTDIR=$HOME/.config/zsh
fi
'';
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
# Enable alternative shell support in nix-darwin.
# 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 = 6;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#Zen
darwinConfigurations."Zen" = nix-darwin.lib.darwinSystem {
modules = [
configuration
./default-system.nix
];
};
};
}

View file

@ -1,54 +0,0 @@
// %UserProfile%\.config\fastfetch\config.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"type": "auto",
// "source": "Windows 7",
"padding": {
"top": 2,
"left": 1,
"right": 2
}
},
"general": {
"multithreading": true
},
"display": {
"separator": " ",
"key": {
"width": 10,
"paddingLeft": 2,
"type": "icon"
}
},
"modules": [
{
"type": "title",
"format": "{#1}───────────── {#}{user-name-colored}@{host-name-colored}"
},
{
"type": "colors",
"symbol": "diamond",
"paddingLeft": 15
},
"os",
"host",
"kernel",
"uptime",
{
"type": "packages"
},
"shell",
"display",
"cursor",
"terminal",
"terminalfont",
"cpu",
"memory",
"swap",
"disk",
"battery",
"poweradapter",
"locale"
]
}

View file

@ -1,25 +0,0 @@
# $XDG_CONFIG_HOME/neovide/config.toml
# ln -sf $DOTFILES/mac/neovide.toml $XDG_CONFIG_HOME/neovide/config.toml
# New-Item -ItemType SymbolicLink -Path $Env:XDG_CONFIG_HOME/neovide/config.toml -Value $DOTFILES\mac\neovide.toml (Mac)
# https://neovide.dev/config-file.html?highlight=toml#config-file
# 设置为 fork 默认后台运行,不会占用终端
fork = true
# frame = "full"
idle = true
maximized = false
# neovim-bin = "/opt/homebrew/bin/nvim"
frame = "transparent"
no-multigrid = false
srgb = false
tabs = true
theme = "auto"
title-hidden = true
vsync = true
wsl = false
[font]
normal = [
"Iosevka Nerd Font",
"霞鹜文楷等宽",
] # Will use the bundled Fira Code Nerd Font by default
size = 14.0

View file

@ -1,23 +0,0 @@
# $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1
# ln -sf $DOTFILES/mac/Microsoft.PowerShell_profile.ps1 $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1
### Variables ###
$DOTFILES = "$HOME/.dotfiles"
### Load Configs ###
Get-ChildItem -Path $(Join-Path $DOTFILES "tools" "powershell") -Filter *.ps1 | ForEach-Object {. $_}
## Aliases ###
# PowerShell Equivalents #
# Set-Alias "curl" "Invoke-WebRequest"
# Set-Alias "man" "Get-Help"
Set-Alias "kill" "Stop-Process"
Set-Alias "open" "Invoke-Item" # Use ii instead of open
# Dev #
${function:zshcfg} = { nvim ~/.zshrc }
${function:bashcfg} = { nvim ~/.bashrc }

View file

@ -1,4 +0,0 @@
tell application "Finder"
activate
make new Finder window
end tell

View file

@ -1,8 +0,0 @@
# $DOTFILES/platforms/mac/zshrc
# Date: 2024-11-30
# Author: js0ny
# Sourced by user's zshrc if is macOS 在用户的 zshrc 中被引用macOS 特定配置
# Entry point in $DOTFILES/tools/zsh/common.zshrc (入口点)
# macOS #