mirror of
https://github.com/cupcakearmy/nix-macos.git
synced 2025-04-02 13:28:13 +00:00
Compare commits
12 Commits
35bcf9f534
...
c11ea192cb
Author | SHA1 | Date | |
---|---|---|---|
c11ea192cb | |||
c05ec2c48e | |||
0772bbbf50 | |||
4c50216342 | |||
d8dbea94c1 | |||
b0c3e9e512 | |||
2d309816ff | |||
3b76820774 | |||
0d0baa3b60 | |||
e96cac4f4b | |||
7a1676b0ea | |||
f32120de52 |
2
.envrc
2
.envrc
@ -1,2 +0,0 @@
|
|||||||
# export SOPS_AGE_KEY_FILE=${HOME}/.config/sops/age/keys.txt
|
|
||||||
export SOPS_AGE_KEY_FILE=$(pwd)/.keys.txt
|
|
@ -1,4 +0,0 @@
|
|||||||
creation_rules:
|
|
||||||
- path_regex: secrets/[^/]+\.(yaml|json|env|ini)$
|
|
||||||
age: >-
|
|
||||||
age1fwwfdh3np846pcwlsre2d8py3a8z5gfltx3jcyghdfx9esn6a40sm60mdj
|
|
14
README.md
14
README.md
@ -25,6 +25,10 @@ nix run nix-darwin -- switch --flake ~/.config/nix-macos#<host>
|
|||||||
vai
|
vai
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
- [nix-darwin](https://daiderd.com/nix-darwin/manual/index.html)
|
||||||
|
|
||||||
## Crypt
|
## Crypt
|
||||||
|
|
||||||
Files under `secrets` are encrypted using `git-crypt`.
|
Files under `secrets` are encrypted using `git-crypt`.
|
||||||
@ -37,3 +41,13 @@ git-crypt export-key - | base64 > .key.b64
|
|||||||
cat .key.b64 | base64 --decode > .key
|
cat .key.b64 | base64 --decode > .key
|
||||||
git-crypt unlock .key
|
git-crypt unlock .key
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
Stuff that I would like to automate, but have not found a way/time
|
||||||
|
|
||||||
|
- Disable the default Spotlight keyboard shortcut. For now manually go to Settings -> Keyboard Shortcuts -> Spotlight -> Untick
|
||||||
|
- `chsh -s /run/current-system/sw/bin/fish`
|
||||||
|
- vscodium settings (download `zokugun.sync-settings` -> open repository settings -> paste secrets/configs/vscodium-sync.yaml -> download config)
|
||||||
|
|
||||||
|
|
||||||
|
71
darwin.nix
71
darwin.nix
@ -20,36 +20,52 @@
|
|||||||
# Nix Darwin
|
# Nix Darwin
|
||||||
# https://daiderd.com/nix-darwin/manual/index.html
|
# https://daiderd.com/nix-darwin/manual/index.html
|
||||||
|
|
||||||
# Security
|
system.defaults = {
|
||||||
system.defaults.screensaver.askForPassword = true;
|
# Security
|
||||||
system.defaults.screensaver.askForPasswordDelay = 0;
|
screensaver.askForPassword = true;
|
||||||
system.defaults.loginwindow.GuestEnabled = false;
|
screensaver.askForPasswordDelay = 0;
|
||||||
|
loginwindow.GuestEnabled = false;
|
||||||
|
|
||||||
# Dock
|
# Dock
|
||||||
system.defaults.dock.autohide = true;
|
dock = {
|
||||||
system.defaults.dock.orientation = "left";
|
autohide = true;
|
||||||
system.defaults.dock.show-recents = false;
|
orientation = "left";
|
||||||
system.defaults.dock.persistent-apps = [
|
show-recents = false;
|
||||||
"/Applications/Arc.app"
|
persistent-apps = [
|
||||||
"/Applications/Ghostty.app"
|
"/Applications/Arc.app"
|
||||||
"/Applications/VSCodium.app"
|
"/Applications/Ghostty.app"
|
||||||
"/Applications/Spotify.app"
|
"/Applications/VSCodium.app"
|
||||||
"/System/Applications/System Settings.app"
|
"/Applications/Spotify.app"
|
||||||
];
|
"/System/Applications/System Settings.app"
|
||||||
system.defaults.dock.persistent-others = [ ];
|
];
|
||||||
|
persistent-others = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Finder
|
||||||
|
finder = {
|
||||||
|
AppleShowAllExtensions = true;
|
||||||
|
ShowPathbar = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Trackpad
|
||||||
|
NSGlobalDomain = {
|
||||||
|
InitialKeyRepeat = 25;
|
||||||
|
KeyRepeat = 2;
|
||||||
|
"com.apple.mouse.tapBehavior" = 1;
|
||||||
|
"com.apple.trackpad.scaling" = 0.875;
|
||||||
|
};
|
||||||
|
trackpad = {
|
||||||
|
Dragging = true;
|
||||||
|
Clicking = true;
|
||||||
|
TrackpadRightClick = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Input devices
|
# Input devices
|
||||||
system.keyboard.enableKeyMapping = true;
|
system.keyboard = {
|
||||||
system.keyboard.remapCapsLockToEscape = true;
|
enableKeyMapping = true;
|
||||||
system.defaults.NSGlobalDomain.InitialKeyRepeat = 25;
|
remapCapsLockToEscape = true;
|
||||||
system.defaults.NSGlobalDomain.KeyRepeat = 2;
|
};
|
||||||
system.defaults.NSGlobalDomain."com.apple.mouse.tapBehavior" = 1;
|
|
||||||
system.defaults.NSGlobalDomain."com.apple.trackpad.scaling" = 0.875;
|
|
||||||
system.defaults.trackpad.Dragging = true;
|
|
||||||
|
|
||||||
# Finder
|
|
||||||
system.defaults.finder.AppleShowAllExtensions = true;
|
|
||||||
system.defaults.finder.ShowPathbar = true;
|
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
system.startup.chime = false;
|
system.startup.chime = false;
|
||||||
@ -59,6 +75,7 @@
|
|||||||
shell = pkgs.fish;
|
shell = pkgs.fish;
|
||||||
};
|
};
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
|
environment.shells = [ pkgs.fish ];
|
||||||
|
|
||||||
homebrew = {
|
homebrew = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
sops-nix,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@ -46,6 +45,9 @@
|
|||||||
g = "lazygit";
|
g = "lazygit";
|
||||||
d = "lazydocker";
|
d = "lazydocker";
|
||||||
vai = "darwin-rebuild switch --flake ~/.config/nix-macos#${host.hostName}";
|
vai = "darwin-rebuild switch --flake ~/.config/nix-macos#${host.hostName}";
|
||||||
|
|
||||||
|
p = "pnpm";
|
||||||
|
px = "pnpm -s dlx";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ with pkgs;
|
|||||||
woff2
|
woff2
|
||||||
bat
|
bat
|
||||||
rsync
|
rsync
|
||||||
sops
|
|
||||||
|
|
||||||
# Dev
|
# Dev
|
||||||
devenv
|
devenv
|
||||||
|
27
scripts/plist/export.sh
Executable file
27
scripts/plist/export.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Create secrets directory if it doesn't exist
|
||||||
|
mkdir -p secrets/plist
|
||||||
|
|
||||||
|
# Array of app IDs to export
|
||||||
|
APP_IDS=(
|
||||||
|
"com.lwouis.alt-tab-macos"
|
||||||
|
"com.jordanbaird.Ice"
|
||||||
|
"com.apphousekitchen.aldente-pro.plist"
|
||||||
|
"com.lihaoyun6.QuickRecorder.plist"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Export each plist
|
||||||
|
for APP_ID in "${APP_IDS[@]}"; do
|
||||||
|
echo "Exporting $APP_ID..."
|
||||||
|
defaults export "$APP_ID" - >"secrets/plist/$APP_ID.plist"
|
||||||
|
|
||||||
|
# Check if export was successful
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Successfully exported $APP_ID to secrets/$APP_ID.plist"
|
||||||
|
else
|
||||||
|
echo "Failed to export $APP_ID"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "All exports completed!"
|
38
scripts/plist/import.sh
Executable file
38
scripts/plist/import.sh
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Path to the plist directory
|
||||||
|
PLIST_DIR="secrets/plist"
|
||||||
|
|
||||||
|
# Check if the plist directory exists
|
||||||
|
if [ ! -d "$PLIST_DIR" ]; then
|
||||||
|
echo "Error: Directory $PLIST_DIR does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get all plist files in the directory
|
||||||
|
PLIST_FILES=("$PLIST_DIR"/*.plist)
|
||||||
|
|
||||||
|
# Check if there are any plist files
|
||||||
|
if [ ${#PLIST_FILES[@]} -eq 0 ] || [ "${PLIST_FILES[0]}" = "$PLIST_DIR/*.plist" ]; then
|
||||||
|
echo "No plist files found in $PLIST_DIR."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Import each plist
|
||||||
|
for PLIST_PATH in "${PLIST_FILES[@]}"; do
|
||||||
|
# Extract app ID from filename (remove path and .plist extension)
|
||||||
|
FILENAME=$(basename "$PLIST_PATH")
|
||||||
|
APP_ID="${FILENAME%.plist}"
|
||||||
|
|
||||||
|
echo "Importing $APP_ID..."
|
||||||
|
cat "$PLIST_PATH" | defaults import "$APP_ID" -
|
||||||
|
|
||||||
|
# Check if import was successful
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Successfully imported $APP_ID from $PLIST_PATH"
|
||||||
|
else
|
||||||
|
echo "Failed to import $APP_ID"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "All imports completed!"
|
BIN
secrets/configs/Raycast 2025-03-10 22.24.34.rayconfig
Normal file
BIN
secrets/configs/Raycast 2025-03-10 22.24.34.rayconfig
Normal file
Binary file not shown.
BIN
secrets/configs/vscodium-sync.yaml
Normal file
BIN
secrets/configs/vscodium-sync.yaml
Normal file
Binary file not shown.
BIN
secrets/licenses/aldente.txt
Normal file
BIN
secrets/licenses/aldente.txt
Normal file
Binary file not shown.
BIN
secrets/plist/com.apphousekitchen.aldente-pro.plist.plist
Normal file
BIN
secrets/plist/com.apphousekitchen.aldente-pro.plist.plist
Normal file
Binary file not shown.
BIN
secrets/plist/com.jordanbaird.Ice.plist
Normal file
BIN
secrets/plist/com.jordanbaird.Ice.plist
Normal file
Binary file not shown.
BIN
secrets/plist/com.lihaoyun6.QuickRecorder.plist.plist
Normal file
BIN
secrets/plist/com.lihaoyun6.QuickRecorder.plist.plist
Normal file
Binary file not shown.
BIN
secrets/plist/com.lwouis.alt-tab-macos.plist
Normal file
BIN
secrets/plist/com.lwouis.alt-tab-macos.plist
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user