Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
cd678c8
chore: Add .gitignore with .aider and .env exclusions
shunkakinoki Feb 2, 2025
5ba3a04
docs: Update README.md and .gitignore with project structure and feat…
shunkakinoki Feb 2, 2025
cb680b4
feat: Add GitHub Codespaces support with install.sh and README updates
shunkakinoki Feb 2, 2025
cfac1d6
feat: Add Codespaces-compatible dotfiles, scripts, and Makefile for c…
shunkakinoki Feb 2, 2025
1e2c622
feat: ini nix home
shunkakinoki Feb 9, 2025
6493d71
chore: update
shunkakinoki Feb 9, 2025
58a04bf
chore: update
shunkakinoki Feb 9, 2025
ab82619
feat: enhance nix configuration with modern tools and settings
shunkakinoki Feb 9, 2025
57841f7
chore: update
shunkakinoki Feb 9, 2025
aa2d15c
chore: update
shunkakinoki Feb 9, 2025
8b4d618
chore: update
shunkakinoki Feb 9, 2025
be255c3
feat: refine macOS system settings and Nix configuration
shunkakinoki Feb 9, 2025
25be98b
chore: update
shunkakinoki Feb 9, 2025
2f0ebaa
chore: update
shunkakinoki Feb 9, 2025
65c222a
chore: update
shunkakinoki Feb 9, 2025
72278eb
chore: update
shunkakinoki Feb 9, 2025
1983d1b
chore: update
shunkakinoki Feb 9, 2025
ace8ba2
chore: update
shunkakinoki Feb 9, 2025
45a0538
chore: update
shunkakinoki Feb 9, 2025
1fe2d39
chore: update
shunkakinoki Feb 9, 2025
40e8ede
chore: update
shunkakinoki Feb 9, 2025
d6501b5
chore: update
shunkakinoki Feb 9, 2025
5a01d12
chore: update
shunkakinoki Feb 9, 2025
7570909
chore: update
shunkakinoki Feb 9, 2025
1e1c6c8
chore: update
shunkakinoki Feb 9, 2025
31254b7
chore: update
shunkakinoki Feb 9, 2025
09f9a2e
chore: update
shunkakinoki Feb 9, 2025
b67cd87
chore: update
shunkakinoki Feb 9, 2025
1eb4779
chore: update
shunkakinoki Feb 9, 2025
ff30dae
chore: update
shunkakinoki Feb 9, 2025
d2f7fb1
chore: update
shunkakinoki Feb 9, 2025
78112dc
chore: update
shunkakinoki Feb 9, 2025
ab36718
chore: update
shunkakinoki Feb 9, 2025
c35369c
chore: update
shunkakinoki Feb 9, 2025
ef112ce
chore: update
shunkakinoki Feb 9, 2025
562963c
chore: update
shunkakinoki Feb 9, 2025
bcf5df6
chore: update
shunkakinoki Feb 9, 2025
39762e0
chore: update
shunkakinoki Feb 9, 2025
657b9f5
chore: update
shunkakinoki Feb 9, 2025
752aeb7
chore: update
shunkakinoki Feb 9, 2025
4a1fbc4
chore: update
shunkakinoki Feb 9, 2025
65a0cbd
chore: update
shunkakinoki Feb 9, 2025
10661d3
chore: update
shunkakinoki Feb 9, 2025
bcdcefc
chore: update
shunkakinoki Feb 9, 2025
52708db
chore: update
shunkakinoki Feb 9, 2025
8c65432
chore: update
shunkakinoki Feb 9, 2025
b014529
chore: update
shunkakinoki Feb 9, 2025
572a01b
chore: update
shunkakinoki Feb 9, 2025
a495d15
chore: update
shunkakinoki Feb 9, 2025
e700692
chore: update
shunkakinoki Feb 9, 2025
8402e06
chore: update
shunkakinoki Feb 9, 2025
4123550
chore: update
shunkakinoki Feb 9, 2025
7aa352a
chore: update
shunkakinoki Feb 9, 2025
ec7a240
chore: update
shunkakinoki Feb 9, 2025
80f0425
chore: update
shunkakinoki Feb 9, 2025
36ec3fc
chore: update
shunkakinoki Feb 9, 2025
cdb1980
chore: update
shunkakinoki Feb 9, 2025
bccd433
chore: update
shunkakinoki Feb 9, 2025
f6d03a2
chore: update
shunkakinoki Feb 9, 2025
d9ce4ef
chore: update
shunkakinoki Feb 9, 2025
0a9e2b7
chore: update
shunkakinoki Feb 9, 2025
6e08bd8
feat: add CI-specific configuration for nix-darwin and home-manager
shunkakinoki Feb 9, 2025
708b626
chore: update
shunkakinoki Feb 9, 2025
c8f996d
chore: update
shunkakinoki Feb 9, 2025
2e218dd
feat: ini refresh
shunkakinoki Feb 9, 2025
b4733c2
chore: update
shunkakinoki Feb 9, 2025
f8b9d03
chore: update
shunkakinoki Feb 9, 2025
76ff2aa
chore: update
shunkakinoki Feb 9, 2025
d96940f
chore: update
shunkakinoki Feb 9, 2025
1ec1c50
chore: update
shunkakinoki Feb 9, 2025
4940a8d
chore: update
shunkakinoki Feb 9, 2025
d9cb871
chore: update
shunkakinoki Feb 9, 2025
2410f58
chore: update
shunkakinoki Feb 9, 2025
c199917
chore: update
shunkakinoki Feb 9, 2025
1347308
chore: update
shunkakinoki Feb 9, 2025
fb58b8b
chore: update dust
shunkakinoki Feb 9, 2025
140ee6c
chore: update
shunkakinoki Feb 9, 2025
da59653
chore: update
shunkakinoki Feb 9, 2025
3fa5ceb
chore: update
shunkakinoki Feb 9, 2025
7f4df54
chore: update
shunkakinoki Feb 9, 2025
d5b63b2
chore: update
shunkakinoki Feb 9, 2025
dd7fd1a
chore: update
shunkakinoki Feb 9, 2025
b5ba99e
chore: update
shunkakinoki Feb 9, 2025
9e64340
chore: update
shunkakinoki Feb 9, 2025
f249996
chore: update
shunkakinoki Feb 9, 2025
9743960
chore: update
shunkakinoki Feb 9, 2025
f09d4b1
chore: update
shunkakinoki Feb 9, 2025
3d6af4b
chore: update
shunkakinoki Feb 9, 2025
134c820
chore: update
shunkakinoki Feb 9, 2025
98609dc
chore: update
shunkakinoki Feb 9, 2025
d06b49a
chore: update
shunkakinoki Feb 9, 2025
1168beb
chore: update
shunkakinoki Feb 9, 2025
81962a7
chore: update
shunkakinoki Feb 9, 2025
731d6b3
chore: update
shunkakinoki Feb 9, 2025
1d6b592
chore: update
shunkakinoki Feb 9, 2025
eb5305d
chore: update
shunkakinoki Feb 10, 2025
101f2da
chore: update
shunkakinoki Feb 10, 2025
c4c5734
chore: update
shunkakinoki Feb 10, 2025
7be0804
chore: update
shunkakinoki Feb 10, 2025
9c388d5
chore: update
shunkakinoki Feb 10, 2025
c4b35b2
chore: update
shunkakinoki Feb 10, 2025
95281b8
chore: update
shunkakinoki Feb 10, 2025
6dc3ef6
chore: update
shunkakinoki Feb 10, 2025
cbb6ed7
chore: update
shunkakinoki Feb 10, 2025
d89359e
chore: update
shunkakinoki Feb 10, 2025
f31c071
chore: update
shunkakinoki Feb 10, 2025
01423ca
chore: update
shunkakinoki Feb 10, 2025
6ccc8fc
chore: update
shunkakinoki Feb 10, 2025
6cdd9f1
chore: update
shunkakinoki Feb 10, 2025
4430c46
chore: update
shunkakinoki Feb 10, 2025
5d07287
chore: update
shunkakinoki Feb 10, 2025
764afbd
chore: update
shunkakinoki Feb 10, 2025
1a2f55e
chore: update
shunkakinoki Feb 10, 2025
c9ff765
chore: update
shunkakinoki Feb 10, 2025
9e9965b
chore: update
shunkakinoki Feb 10, 2025
a53662c
chore: update
shunkakinoki Feb 10, 2025
0af5161
chore: update
shunkakinoki Feb 12, 2025
01bcb79
chore: update
shunkakinoki Feb 12, 2025
e1bb695
chore: update
shunkakinoki Feb 12, 2025
2631a30
chore: update
shunkakinoki Feb 12, 2025
775d091
chore: update
shunkakinoki Feb 12, 2025
7232311
chore: update
shunkakinoki Feb 12, 2025
e0a1b1f
chore: update
shunkakinoki Feb 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Nix
on:
pull_request:
branches:
- main
jobs:
nix-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Flake Check
run: nix flake check --all-systems
nix-darwin:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare system files
run: |
sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin || true
sudo mv /etc/shells /etc/shells.before-nix-darwin || true
- name: Run Nix Darwin
run: make update
nix-format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check formatting
run: make nix-format-check
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

# AI
.aider*

# Nix
.nix-defexpr
.nix-profile
.nix-store
.nix-channels

# Ignore
result
ref
167 changes: 167 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
##@ Variables

# Detect architecture and OS
ARCH := $(shell uname -m)
OS := $(shell uname -s)

# Nix configuration system
NIX_SYSTEM := $(shell if [ "$(OS)" = "Darwin" ] && [ "$(ARCH)" = "arm64" ]; then \
echo "aarch64-darwin"; \
elif [ "$(OS)" = "Darwin" ] && [ "$(ARCH)" = "x86_64" ]; then \
echo "x86_64-darwin"; \
elif [ "$(OS)" = "Linux" ] && [ "$(ARCH)" = "x86_64" ]; then \
echo "x86_64-linux"; \
elif [ "$(OS)" = "Linux" ] && [ "$(ARCH)" = "aarch64" ]; then \
echo "aarch64-linux"; \
else \
echo "unsupported"; \
fi)
NIX_CONFIG_TYPE := $(shell if [ "$(OS)" = "Darwin" ]; then \
echo "darwinConfigurations"; \
else \
echo "nixosConfigurations"; \
fi)
NIX_ENV := $(shell . ~/.nix-profile/etc/profile.d/nix.sh 2>/dev/null || echo "not_found")
NIX_FLAGS := --extra-experimental-features 'flakes nix-command'

# User's home directory
HOME_DIR := $(shell echo $$HOME)
CONFIG_DIR := $(HOME_DIR)/.config

##@ Help

# Default target
.PHONY: default
default: help

# Help target
.PHONY: help
help:
@echo "Available targets:"
@echo " install - Set up full environment"
@echo " build - Build Nix configuration"
@echo " switch - Apply Nix configuration"
@echo " update - Update Nix flake and configurations"
@echo " format - Format Nix files"
@echo " format-check - Check Nix formatting"
@echo " pr - Create and push a PR (usage: make pr m='commit message' b='branch-name' t='PR title')"

##@ General

.PHONY: install
install: nix-install

.PHONY: build
build: nix-build

.PHONY: check
check: nix-check

.PHONY: format
format: nix-format

.PHONY: switch
switch: nix-switch

.PHONY: update
update: nix-update

##@ Nix

.PHONY: nix-check
nix-check:
@echo "Checking Nix environment..."
@if [ "$(NIX_ENV)" = "not_found" ]; then \
echo "❌ Nix environment not found. Please ensure Nix is installed and run:"; \
exit 1; \
fi
@echo "✅ Nix environment found!"

.PHONY: nix-install
nix-install:
@if [ "$(NIX_ENV)" = "not_found" ]; then \
echo "Installing Nix environment..."; \
curl -L https://nixos.org/nix/install | sh; \
fi
@echo "✅ Nix environment installed!"

.PHONY: nix-update
nix-update: nix-flake-update nix-switch

.PHONY: nix-flake-update
nix-flake-update:
@echo "🔄 Updating flake.lock..."
@if [ "$$CI" = "true" ]; then \
echo "Bypassing flake update in CI"; \
else \
nix flake update $(NIX_FLAGS); \
fi
@echo "✨ flake.lock updated!"

.PHONY: nix-format
nix-format:
@echo "Formatting Nix files..."
@nix fmt
@echo "✨ Formatting complete"

.PHONY: nix-format-check
nix-format-check:
@echo "Checking Nix formatting..."
@nix fmt -- --fail-on-change
@echo "✅ All Nix files are properly formatted"

.PHONY: nix-build
nix-build:
@echo "🔄 Building Nix configuration..."
@if [ "$$CI" = "true" ]; then \
echo "Running in CI"; \
nix build .#darwinConfigurations.runner.system $(NIX_FLAGS) --show-trace; \
else \
if [ "$(NIX_SYSTEM)" = "unsupported" ]; then \
echo "❌ Unsupported system architecture: $(OS) $(ARCH)"; \
exit 1; \
fi; \
nix build .#$(NIX_CONFIG_TYPE).$(NIX_SYSTEM).system $(NIX_FLAGS) --show-trace; \
fi
@echo "✅ Nix configuration built successfully!"

.PHONY: nix-switch
nix-switch: nix-build
@echo "🔄 Applying Nix configuration..."
@if [ "$$CI" = "true" ]; then \
./result/sw/bin/darwin-rebuild switch --flake .#runner; \
elif [ "$(OS)" = "Darwin" ]; then \
./result/sw/bin/darwin-rebuild switch --flake .#$(NIX_SYSTEM); \
else \
sudo nixos-rebuild switch --flake .#$(NIX_SYSTEM); \
fi
@echo "✨ Configuration applied successfully!"

##@ GitHub

.PHONY: pr
pr:
@if ! command -v gh &> /dev/null; then \
echo "❌ GitHub CLI not found. Please run 'make install' to install it."; \
exit 1; \
fi
@if [ -z "$(b)" ]; then \
echo "❌ Branch name required. Usage: make pr m='commit message' b='branch-name' t='PR title'"; \
exit 1; \
fi
@if [ -z "$(m)" ]; then \
echo "❌ Commit message required. Usage: make pr m='commit message' b='branch-name' t='PR title'"; \
exit 1; \
fi
@echo "Creating PR branch and pushing changes..."
@git checkout -b feature/$(b)
@git add .
@git commit -m "$(m)"
@git push -u origin feature/$(b)
@echo "Creating PR..."
@if [ -z "$(t)" ]; then \
gh pr create --fill; \
else \
gh pr create --title "$(t)" --body "$(m)"; \
fi
@echo "✨ PR created successfully!"
Loading