Initial commit
Some checks failed
CI / check (push) Has been cancelled
CI / ida (push) Has been cancelled
CI / cpt (push) Has been cancelled
CI / build-nixos (ena) (push) Has been cancelled
CI / build-nixos (hako) (push) Has been cancelled
CI / build-nixos (kazusa) (push) Has been cancelled
CI / build-nixos (mizuki) (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
CI / ida (push) Has been cancelled
CI / cpt (push) Has been cancelled
CI / build-nixos (ena) (push) Has been cancelled
CI / build-nixos (hako) (push) Has been cancelled
CI / build-nixos (kazusa) (push) Has been cancelled
CI / build-nixos (mizuki) (push) Has been cancelled
This commit is contained in:
commit
70284509f3
144 changed files with 7061 additions and 0 deletions
34
hosts/machine/kanade/modules/mac/avatar.nix
Normal file
34
hosts/machine/kanade/modules/mac/avatar.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
avatar = pkgs.runCommand "kanade-avatar.jpg" { nativeBuildInputs = [ pkgs.imagemagick ]; } ''
|
||||
magick "${inputs.self}/assets/avatar.webp" -quality 92 "$out"
|
||||
'';
|
||||
in
|
||||
{
|
||||
system.activationScripts.postActivation.text = ''
|
||||
avatarPath="/Library/User Pictures/imnyang.jpg"
|
||||
importFile="$(/usr/bin/mktemp /tmp/imnyang-avatar.XXXXXX)"
|
||||
|
||||
/usr/bin/install -d -m 0755 "/Library/User Pictures"
|
||||
/usr/bin/install -m 0644 "${avatar}" "$avatarPath"
|
||||
|
||||
# Replace both account-picture representations. JPEGPhoto is embedded in
|
||||
# the directory record and is used by the login screen and System Settings.
|
||||
/usr/bin/dscl . -delete /Users/imnyang JPEGPhoto >/dev/null 2>&1 || true
|
||||
/usr/bin/dscl . -delete /Users/imnyang Picture >/dev/null 2>&1 || true
|
||||
/usr/bin/dscl . -create /Users/imnyang Picture "$avatarPath"
|
||||
|
||||
/usr/bin/printf '%s\n%s:%s' \
|
||||
'0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Users 2 dsAttrTypeStandard:RecordName externalbinary:dsAttrTypeStandard:JPEGPhoto' \
|
||||
'imnyang' \
|
||||
"$avatarPath" > "$importFile"
|
||||
/usr/bin/dsimport "$importFile" /Local/Default M
|
||||
/bin/rm -f "$importFile"
|
||||
|
||||
/usr/bin/dscacheutil -flushcache
|
||||
'';
|
||||
}
|
||||
10
hosts/machine/kanade/modules/mac/default.nix
Normal file
10
hosts/machine/kanade/modules/mac/default.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
imports = [
|
||||
./avatar.nix
|
||||
./dock.nix
|
||||
./keyboard.nix
|
||||
./preferences.nix
|
||||
./touch-id.nix
|
||||
./wallpaper.nix
|
||||
];
|
||||
}
|
||||
36
hosts/machine/kanade/modules/mac/dock.nix
Normal file
36
hosts/machine/kanade/modules/mac/dock.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
system.defaults.dock = {
|
||||
autohide = false;
|
||||
show-recents = true;
|
||||
|
||||
wvous-bl-corner = 1;
|
||||
wvous-br-corner = 1;
|
||||
wvous-tl-corner = 1;
|
||||
wvous-tr-corner = 1;
|
||||
|
||||
persistent-apps = [
|
||||
"/System/Applications/Apps.app"
|
||||
"/Applications/Microsoft Edge Canary.app"
|
||||
"/Applications/Discord.app"
|
||||
"/Applications/KakaoTalk.app"
|
||||
"/Applications/Signal.app"
|
||||
"/Applications/Proton Mail.app"
|
||||
# "/Applications/Proton Pass.app"
|
||||
# "/System/Applications/Mail.app"
|
||||
"/Applications/1Password.app"
|
||||
"/Applications/Figma.app"
|
||||
"/Applications/Notion.app"
|
||||
# "/Applications/Notion Calendar.app"
|
||||
"${pkgs.utm}/Applications/UTM.app"
|
||||
"/Applications/Spotify.app"
|
||||
"${pkgs.ghostty-bin}/Applications/Ghostty.app"
|
||||
"/Applications/Visual Studio Code - Insiders.app"
|
||||
"/Applications/Zed.app"
|
||||
"/System/Applications/System Settings.app"
|
||||
];
|
||||
mru-spaces = false;
|
||||
tilesize = 48;
|
||||
orientation = "bottom";
|
||||
};
|
||||
}
|
||||
14
hosts/machine/kanade/modules/mac/keyboard.nix
Normal file
14
hosts/machine/kanade/modules/mac/keyboard.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
system.keyboard.enableKeyMapping = true;
|
||||
|
||||
system.defaults.NSGlobalDomain = {
|
||||
ApplePressAndHoldEnabled = false;
|
||||
InitialKeyRepeat = 15;
|
||||
KeyRepeat = 2;
|
||||
NSAutomaticCapitalizationEnabled = false;
|
||||
NSAutomaticDashSubstitutionEnabled = false;
|
||||
NSAutomaticPeriodSubstitutionEnabled = false;
|
||||
NSAutomaticQuoteSubstitutionEnabled = false;
|
||||
NSAutomaticSpellingCorrectionEnabled = false;
|
||||
};
|
||||
}
|
||||
92
hosts/machine/kanade/modules/mac/preferences.nix
Normal file
92
hosts/machine/kanade/modules/mac/preferences.nix
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
# sudo_local is managed as a regular file by touch-id.nix because macOS 26
|
||||
# rejects nix-darwin's symlink-based /etc/pam.d management.
|
||||
security.pam.services.sudo_local.enable = false;
|
||||
|
||||
networking = {
|
||||
hostName = "kanade";
|
||||
computerName = "kanade";
|
||||
localHostName = "kanade";
|
||||
};
|
||||
|
||||
time.timeZone = "Asia/Seoul";
|
||||
|
||||
# Keep the terminal font declared in the Ghostty Home Manager module available
|
||||
# to native macOS applications as well.
|
||||
fonts.packages = [ pkgs.nerd-fonts.jetbrains-mono ];
|
||||
|
||||
system.defaults = {
|
||||
NSGlobalDomain = {
|
||||
AppleICUForce24HourTime = true;
|
||||
AppleMeasurementUnits = "Centimeters";
|
||||
AppleTemperatureUnit = "Celsius";
|
||||
|
||||
AppleInterfaceStyleSwitchesAutomatically = false;
|
||||
AppleInterfaceStyle = null;
|
||||
|
||||
NSAutomaticCapitalizationEnabled = false;
|
||||
NSAutomaticDashSubstitutionEnabled = false;
|
||||
NSAutomaticPeriodSubstitutionEnabled = false;
|
||||
NSAutomaticQuoteSubstitutionEnabled = false;
|
||||
NSAutomaticSpellingCorrectionEnabled = false;
|
||||
|
||||
AppleShowAllExtensions = true;
|
||||
AppleShowAllFiles = true;
|
||||
NSNavPanelExpandedStateForSaveMode = true;
|
||||
NSNavPanelExpandedStateForSaveMode2 = true;
|
||||
"com.apple.sound.beep.feedback" = 0;
|
||||
};
|
||||
|
||||
SoftwareUpdate = {
|
||||
AutomaticallyInstallMacOSUpdates = false;
|
||||
};
|
||||
|
||||
finder = {
|
||||
AppleShowAllExtensions = true;
|
||||
FXEnableExtensionChangeWarning = false;
|
||||
FXDefaultSearchScope = "SCcf";
|
||||
FXRemoveOldTrashItems = true;
|
||||
ShowPathbar = true;
|
||||
ShowStatusBar = true;
|
||||
# _FXShowPosixPathInTitle = true;
|
||||
};
|
||||
|
||||
menuExtraClock = {
|
||||
ShowAMPM = false;
|
||||
ShowDate = 1;
|
||||
ShowSeconds = false;
|
||||
Show24Hour = true;
|
||||
};
|
||||
|
||||
trackpad = {
|
||||
Clicking = true;
|
||||
TrackpadRightClick = true;
|
||||
TrackpadThreeFingerDrag = true;
|
||||
};
|
||||
|
||||
loginwindow.GuestEnabled = false;
|
||||
|
||||
CustomUserPreferences = {
|
||||
"com.apple.AdLib" = {
|
||||
allowApplePersonalizedAdvertising = false;
|
||||
};
|
||||
"com.apple.controlcenter" = {
|
||||
BatteryShowPercentage = true;
|
||||
};
|
||||
"com.apple.desktopservices" = {
|
||||
DSDontWriteNetworkStores = true;
|
||||
DSDontWriteUSBStores = true;
|
||||
};
|
||||
"com.apple.finder"._FXSortFoldersFirst = true;
|
||||
"com.apple.screensaver" = {
|
||||
askForPassword = 1;
|
||||
askForPasswordDelay = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
system.activationScripts.postActivation.text = ''
|
||||
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
||||
'';
|
||||
}
|
||||
12
hosts/machine/kanade/modules/mac/touch-id.nix
Normal file
12
hosts/machine/kanade/modules/mac/touch-id.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
sudoLocal = pkgs.writeText "sudo_local" ''
|
||||
# Managed by nix-darwin: use Touch ID for sudo with password fallback.
|
||||
auth sufficient pam_tid.so
|
||||
'';
|
||||
in
|
||||
{
|
||||
system.activationScripts.postActivation.text = ''
|
||||
/usr/bin/install -m 0444 "${sudoLocal}" /etc/pam.d/sudo_local
|
||||
'';
|
||||
}
|
||||
42
hosts/machine/kanade/modules/mac/wallpaper.nix
Normal file
42
hosts/machine/kanade/modules/mac/wallpaper.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
wallpaper = "${inputs.self}/assets/wallpaper/wallpaper1.jpg";
|
||||
setWallpaperScript = pkgs.writeShellScriptBin "set-wallpaper-script" ''
|
||||
set -eu
|
||||
|
||||
# System Events runs in the logged-in Aqua session and updates every Space.
|
||||
# Retry because launch agents can start before the desktop is fully ready.
|
||||
for attempt in {1..12}; do
|
||||
if /usr/bin/osascript <<'APPLESCRIPT'
|
||||
tell application "System Events"
|
||||
tell every desktop
|
||||
set picture to "${wallpaper}"
|
||||
end tell
|
||||
end tell
|
||||
APPLESCRIPT
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
/bin/sleep 5
|
||||
done
|
||||
|
||||
exit 1
|
||||
'';
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [ setWallpaperScript ];
|
||||
|
||||
launchd.user.agents.set-wallpaper = {
|
||||
command = "${setWallpaperScript}/bin/set-wallpaper-script";
|
||||
serviceConfig = {
|
||||
RunAtLoad = true;
|
||||
ProcessType = "Interactive";
|
||||
LimitLoadToSessionType = "Aqua";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue