Add a new utility script for splitting files into 1GB chunks:
,split-1G - File splitting wrapper
- Splits one or more files into 1GB chunks with numeric suffixes
- Uses split(1) with --bytes=1G for consistent chunk sizes
- Generates 5-digit numeric suffixes (.00000, .00001, etc) for up to 99,999 parts
- Outputs verbose progress information during splitting
- Fails fast with set -e to catch errors during multi-file operations
- Added to tb-scripts package with coreutils as runtime dependency
This is useful for preparing large files for upload to services with file
size limits, or for splitting backups/archives into manageable pieces.
Example usage:
,split-1G large-backup.tar.gz
# Creates: large-backup.tar.gz.00000, large-backup.tar.gz.00001, ...
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add two new shell utility scripts to the custom script packages:
,optipng - Parallel PNG optimization wrapper
- Detects available CPU cores and runs optipng in parallel using xargs
- Accepts optional file arguments, defaults to all *.png in current dir
- Uses maximum compression level (-o7) for best results
- Added to tb-dev-scripts package with optipng as runtime dependency
,zipdir - Quick directory archiving helper
- Creates a zip archive of the current directory
- Names the archive after the directory and places it in parent folder
- Uses maximum compression (-9) with extra attributes excluded (-X)
- Added to tb-scripts package with zip as runtime dependency
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit makes two significant changes to the Emacs configuration:
1. Refactors emacs.nix to use proper NixOS module structure:
- Converts from simple configuration to a module with options/config
- Adds `tb.emacs.extraSnippetDirs` option to allow per-machine snippet
directories (defaults to ~/.emacs.d/snippets/)
- Moves yasnippet configuration from custom.el to nix-generated elisp,
enabling dynamic snippet directory configuration via Nix
2. Adds a comprehensive collection of yasnippet snippets for multiple modes:
- C++ mode: 50 snippets for common patterns (class, namespace, operators,
copy/move semantics, debug helpers, documentation, threading primitives)
- CC mode (shared C/C++): for, switch, main, include guards, etc.
- CMake mode: if/else, foreach, function, macro, project boilerplate
- LaTeX mode: document structure, beamer frames, figures, lists
- Perl mode: package boilerplate, shebang
- Python/Shell/Nix/Protobuf/Java/CSS/Dockerfile modes: horizontal rules
and common patterns
- Text mode: modeline snippets for locale settings
The snippets use yasnippet's inheritance system via .yas-parents files,
so c++-mode inherits from cc-mode and text-mode, reducing duplication.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit introduces two new custom script packages: tb-scripts for
all systems and tb-dev-scripts for development machines. These packages
provide a maintainable way to distribute utility scripts across the
infrastructure with proper dependency management.
Created pkgs/ directory with two script collections:
1. **tb-scripts** - General utilities available on all systems:
- ,jq_reformat: Reformat JSON files in-place with atomic file operations
- ,rename_lower: Convert filenames to lowercase with validation
2. **tb-dev-scripts** - Development-specific tools:
- ,cmake_update_fetchcontent: Update CMake FetchContent dependencies
All scripts have been significantly enhanced from their original versions:
- Proper quoting to handle filenames with spaces
- Secure temporary file creation using mktemp
- Atomic file replacement to prevent data loss
- Input validation and comprehensive error handling
- Usage help with -h/--help flag
- Extensive inline comments explaining each section
- Cleanup traps on error
- Complete rewrite in Python for consistency
- Validates files exist before attempting rename
- Checks if target lowercase filename already exists
- Skips files already lowercase (no-op)
- Descriptive error messages for each failure case
- Usage documentation with examples
- Proper exit codes
- Interactive CMake FetchContent dependency updater
- Recursively finds all CMakeLists.txt files via add_subdirectory()
- Queries GitHub API for latest releases/tags
- Compares semantic versions and commit hashes
- Shows available updates in formatted table
- Prompts for confirmation before applying updates
- Atomic file updates with validation
Scripts are packaged using writeShellApplication with proper dependency
injection via runtimeInputs:
- tb-scripts requires: jq, python3
- tb-dev-scripts requires: python3, git
Dependencies are automatically available in PATH when scripts run,
eliminating manual dependency checks.
Created system module files to import the script packages:
- system/default/scripts.nix: Adds tb-scripts to nixosModules.default
- system/develop/scripts.nix: Adds tb-dev-scripts to nixosModules.develop
Updated flake.nix to import these modules in the appropriate contexts.
- Scripts have proper Nix-managed dependencies
- No manual installation or PATH configuration needed
- Easy to extend with additional scripts
- Scripts are validated with shellcheck during build
- Clear separation between all-systems and dev-only utilities
- Comprehensive error handling and user documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit introduces a new home-manager module that provides declarative
configuration management for Claude Code, Anthropic's official CLI tool. The
module follows the established pattern used by other home-manager modules in
this flake (default, private, macos, develop) and enables users to deploy
custom Claude Code slash commands and configuration files to ~/.claude/.
Changes included:
1. Created home/claude/config.nix module:
- Defines a new home-manager module for Claude Code configuration
- Uses home.file to deploy command files from the Nix store to ~/.claude/
- Currently deploys two custom slash commands to ~/.claude/commands/
2. Added two custom slash commands:
- commit.md: Automates git commit creation by reading staged diffs and
generating comprehensive commit messages
- go-plan.md: Writes detailed implementation plans to PLAN.md before
starting work, supporting the planning workflow
3. Registered homeManagerModules.claude in flake.nix:
- Added as a new, independent module group that can be imported separately
- Positioned after the develop module for logical organization
- Can be enabled by importing inputs.nix-shared.homeManagerModules.claude
4. Enhanced flake.nix documentation:
- Added descriptive comments for all nixosModules and homeManagerModules
- Clarifies the purpose of each module group (e.g., "Linux specific system
configuration", "Add private homelab and cloud host aliases")
- Improves maintainability and makes the flake structure self-documenting
The module structure supports easy extension - additional slash commands or
configuration files can be added by placing them in home/claude/config/ and
adding corresponding home.file entries in config.nix.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>