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

This commit is contained in:
암냥 2026-07-03 16:53:49 +09:00
commit 70284509f3
No known key found for this signature in database
144 changed files with 7061 additions and 0 deletions

View 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
'';
}

View file

@ -0,0 +1,10 @@
{
imports = [
./avatar.nix
./dock.nix
./keyboard.nix
./preferences.nix
./touch-id.nix
./wallpaper.nix
];
}

View 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";
};
}

View 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;
};
}

View 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
'';
}

View 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
'';
}

View 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";
};
};
}