mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
nix-darwin
This commit is contained in:
parent
598597e3ca
commit
1d1371be2b
5 changed files with 308 additions and 0 deletions
49
nix/flake.lock
generated
Normal file
49
nix/flake.lock
generated
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nix-darwin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1751313918,
|
||||||
|
"narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=",
|
||||||
|
"owner": "nix-darwin",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-darwin",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1753934836,
|
||||||
|
"narHash": "sha256-G06FmIBj0I5bMW1Q8hAEIl5N7IHMK7+Ta4KA+BmneDA=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "8679b16e11becd487b45d568358ddf9d5640d860",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nix-darwin": "nix-darwin",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
21
nix/flake.nix
Normal file
21
nix/flake.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
description = "My macOS Flake config";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
nix-darwin.url = "github:nix-darwin/nix-darwin/master";
|
||||||
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, nix-darwin, ... }: {
|
||||||
|
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
|
||||||
|
system = "aarch64-darwin";
|
||||||
|
modules = [
|
||||||
|
./hosts/macbook/default.nix
|
||||||
|
./hosts/macbook/brew.nix
|
||||||
|
./hosts/macbook/system.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
70
nix/hosts/macbook/brew.nix
Normal file
70
nix/hosts/macbook/brew.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
{ config, pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
homebrew = {
|
||||||
|
enable = true;
|
||||||
|
brewPrefix = "/opt/homebrew/bin";
|
||||||
|
taps = [
|
||||||
|
"daipeihust/tap"
|
||||||
|
"felixkratz/formulae"
|
||||||
|
"koekeishiya/formulae"
|
||||||
|
"nikitabobko/tap"
|
||||||
|
"railwaycat/emacsmacport"
|
||||||
|
"js0ny/tap"
|
||||||
|
];
|
||||||
|
|
||||||
|
brews = [
|
||||||
|
"folderify"
|
||||||
|
"coreutils"
|
||||||
|
];
|
||||||
|
|
||||||
|
casks = [
|
||||||
|
"visual-studio-code"
|
||||||
|
"kitty"
|
||||||
|
"vivaldi"
|
||||||
|
"neovide"
|
||||||
|
"clash-verge-rev"
|
||||||
|
"obsidian"
|
||||||
|
"mullvad-vpn"
|
||||||
|
"alacritty"
|
||||||
|
"alt-tab"
|
||||||
|
"apparency"
|
||||||
|
"betterdisplay"
|
||||||
|
"discord"
|
||||||
|
"dotnet-sdk"
|
||||||
|
"iina"
|
||||||
|
"iterm2"
|
||||||
|
"karabiner-elements"
|
||||||
|
"keka"
|
||||||
|
"localsend"
|
||||||
|
"ltspice"
|
||||||
|
"orbstack"
|
||||||
|
"qlcolorcode"
|
||||||
|
# "qlimagesize" discontinued.
|
||||||
|
"qlmarkdown"
|
||||||
|
"qlstephen"
|
||||||
|
"qlvideo"
|
||||||
|
"qspace-pro"
|
||||||
|
"quicklook-json"
|
||||||
|
"quicklookase"
|
||||||
|
"raycast"
|
||||||
|
"rider"
|
||||||
|
"rustdesk"
|
||||||
|
"scroll-reverser"
|
||||||
|
"sioyek"
|
||||||
|
"skim"
|
||||||
|
"squirrel"
|
||||||
|
"steam"
|
||||||
|
"telegram-desktop"
|
||||||
|
"Filen"
|
||||||
|
"TickTick"
|
||||||
|
"cherry-studio"
|
||||||
|
"firefox"
|
||||||
|
"Wireshark"
|
||||||
|
"LibreWolf"
|
||||||
|
"brave-browser"
|
||||||
|
"font-maple-mono-nf-cn"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
54
nix/hosts/macbook/default.nix
Normal file
54
nix/hosts/macbook/default.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Managed by Determinate
|
||||||
|
nix.enable = false;
|
||||||
|
system.stateVersion = 6;
|
||||||
|
system.primaryUser = "js0ny";
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
vim
|
||||||
|
wget
|
||||||
|
age
|
||||||
|
aichat
|
||||||
|
bat
|
||||||
|
btop
|
||||||
|
cmake
|
||||||
|
coreutils
|
||||||
|
curlie
|
||||||
|
dos2unix
|
||||||
|
duf
|
||||||
|
dust
|
||||||
|
duti
|
||||||
|
fastfetch
|
||||||
|
fd
|
||||||
|
ffmpeg
|
||||||
|
fish
|
||||||
|
fzf
|
||||||
|
delta
|
||||||
|
glow
|
||||||
|
go
|
||||||
|
hyperfine
|
||||||
|
imagemagick
|
||||||
|
just
|
||||||
|
lazygit
|
||||||
|
less
|
||||||
|
lsd
|
||||||
|
neovim
|
||||||
|
nushell
|
||||||
|
pandoc
|
||||||
|
procs
|
||||||
|
pnpm
|
||||||
|
ripgrep
|
||||||
|
ripgrep-all
|
||||||
|
starship
|
||||||
|
tlrc
|
||||||
|
tmux
|
||||||
|
uv
|
||||||
|
zoxide
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
|
}
|
||||||
114
nix/hosts/macbook/system.nix
Normal file
114
nix/hosts/macbook/system.nix
Normal file
|
|
@ -0,0 +1,114 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
time.timeZone = "Asia/Shanghai";
|
||||||
|
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/kitty.app"; }
|
||||||
|
{ app = "/Applications/Obsidian.app"; }
|
||||||
|
{ app = "Applications/Visual Studio Code.app"; }
|
||||||
|
{ app = "/Applications/LibreWolf.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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue