A collection of personal utility scripts and services for NixOS systems. This toolkit provides a unified interface for managing and running various shell scripts, Python utilities, and systemd services.
- Unified Command Interface:
my-toolkit - Shell Scripts - Utility scripts for common tasks
- Python Scripts - Advanced utilities and automation
- Systemd Services - Background automation services
- π¬ Torrent Manager - Isolated torrent downloading and viewing with bubblewrap
- π¦ Flake Apps - Run tools without installation using
nix run
For Development: If you are contributing or testing changes, see the Development section for a faster workflow using
nix develop.
Add the toolkit to your NixOS configuration by adding the following to your flake.nix:
inputs = {
my-toolkit.url = "github:kouloumos/my-toolkit";
# ... your other inputs
};Then in your configuration.nix:
imports = [
inputs.my-toolkit.nixosModules.default
];
# Enable the toolkit
my-toolkit.enable = true;
# Optionally enable specific services
my-toolkit.services = {
media-renamer = true;
ebook-organizer = true;
};After making changes to your configuration, rebuild your system:
sudo nixos-rebuild switchThe my-toolkit command provides a unified interface for all your scripts:
# List all available scripts
my-toolkit list
# Run a shell script
my-toolkit video2gif input.mp4
# Run a Python script
my-toolkit book-downloaderRun tools directly without installing using nix run:
# Try the torrent manager instantly
nix run github:kouloumos/my-toolkit#torrent-search -- "Movie Name"
# Watch a movie (after downloading)
nix run github:kouloumos/my-toolkit#torrent-list
nix run github:kouloumos/my-toolkit#torrent-watch -- 1
# Other utilities
nix run github:kouloumos/my-toolkit#video2gif -- input.mp4 output.gif
nix run github:kouloumos/my-toolkit#find-subtitles -- movie.mkvAvailable apps: torrent-search, torrent-list, torrent-watch, torrent-cleanup, download-torrent, find-subtitles, video2gif, upload-to-remarkable, book-downloader, worktree
This is perfect for:
- π Trying the tools before installing
- π§ One-off tasks on servers
- π¦ Sharing tools with others
- π§ͺ Testing specific versions/commits
Complete torrent management with isolated playback:
torrent-search: Search and download movies from YTStorrent-list: List all cached moviestorrent-watch: Watch movies in isolated VLC (bubblewrap sandbox, no network)torrent-cleanup: Remove movies and clean cache
Quick Start:
# Search and download
my-toolkit torrent-search "Knives Out"
# List cached movies
my-toolkit torrent-list
# Watch with isolation (VLC sandboxed, no network)
my-toolkit torrent-watch 1
# Cleanup when done
my-toolkit torrent-cleanup 1download-torrent: Downloads torrent files or magnet links using transmission-cli, with optional automatic subtitle searchvideo2gif: Converts video files to optimized GIF formatmerge_videos: Merges multiple WebM video filesupload_to_remarkable: Uploads files (PDF, EPUB, TXT) to reMarkable tablet via USBepub-to-kindle: Converts all EPUB files in a folder to Amazon Kindle format (AZW3)
find-subtitles: Finds and downloads subtitles for video files in multiple languagesbook-downloader: Downloads e-books from various sourcestxt-to-docx: Converts text files to DOCX formatworktree: Manage git worktrees (create, teardown, land, list)wt: Quick worktree launcher with progressive prompting
Start working on any project from anywhere with wt:
# First time: configure your code directories
wt config add-dir ~/code
wt config add-dir ~/projects
# Then from anywhere:
wt # Interactive: pick project, enter branch
wt bitcoin feature-x # Direct: create worktree immediately
wt btc feature-x # Use aliases for speed
wt --last bugfix # Reuse last projectFeatures:
- Progressive prompting: Only prompts for what you don't provide
- Project discovery: Auto-finds git repos in configured directories
- Aliases: Create shortcuts like
btcβbitcoin - fzf integration: Fast fuzzy project selection
The toolkit includes several systemd services that can be enabled individually. To see which services are available and their status:
my-toolkit listFor more information about each service and how to add new ones, see the Systemd Services README.
The torrent-watch command runs VLC in a bubblewrap sandbox for maximum security when watching potentially untrusted content:
Isolation Features:
- β
Network Disabled: VLC has no internet access (
--unshare-net) - β Read-Only Files: Video files mounted read-only
- β Minimal Filesystem: Only essential system files accessible
- β No Home Access: Your home directory is not accessible
- β Ephemeral Runtime: Sandbox disappears after playback
This means you can safely watch downloaded content with strong isolation between VLC and your system.
Example:
# Downloads to ~/.cache/my-toolkit/torrents
my-toolkit torrent-search "Movie Name"
# Watches in isolated VLC (no network, sandboxed)
my-toolkit torrent-watch 1
# Clean up when done
my-toolkit torrent-cleanup 1If your ISP blocks torrent sites, you can configure a residential proxy using Squid.
Squid is currently marked as insecure in nixpkgs. We plan to replace it with a more secure alternative in the future.
Quick Setup:
# 1. Configure residential proxy
my-toolkit proxy-setup configure "http://user:pass@proxy.example.com:port"
# 2. Enable in your NixOS configuration:
# Add to configuration.nix:
{
my-toolkit = {
enable = true;
services.residential-proxy = true;
};
# Allow insecure squid (version depends on your nixpkgs)
nixpkgs.config.permittedInsecurePackages = [
"squid-6.8" # For nixos-24.05 (stable)
"squid-7.0.1" # For nixos-unstable
];
}
# 3. Rebuild your system
sudo nixos-rebuild switch
# 4. Test the proxy
my-toolkit proxy-setup testAlternative: Use VPN
You can also use a VPN instead of the proxy:
# Connect to VPN first, then:
my-toolkit torrent-search "Movie Name"Features:
- β Automatic Detection: Scripts automatically use proxy when configured
- β Squid-based: Industry-standard HTTP proxy
- β NixOS Service: Managed by systemd
- β Credential Security: Config file protected (chmod 600)
Supported Providers:
- DataImpulse (with country routing:
user__cr.cy,gr:pass@gw.dataimpulse.com:823) - Any HTTP/HTTPS proxy service
All scripts (torrent-search, book-downloader, find-subtitles) automatically use the proxy when configured.
Commands:
my-toolkit proxy-setup status # Show proxy status
my-toolkit proxy-setup test -v # Test with verbose output
my-toolkit proxy-setup disable # Disable proxy
my-toolkit health-check # Comprehensive health checkBuilt-in health check to verify everything is working correctly:
# Full system health check
my-toolkit health-check
# Verbose output
my-toolkit health-check -v
# Only check proxy
my-toolkit health-check --proxy
# Only check network
my-toolkit health-check --networkChecks performed:
- β Configuration files and directories
- β Proxy service status
- β Network connectivity and IP changes
- β YTS API accessibility
- β Torrent cache status
- β Required dependencies
Exit codes:
0- All checks passed1- One or more checks failed (with helpful diagnostics)
Perfect for troubleshooting when things don't work as expected!
For development and testing, simply use the development environment:
# Clone the repository
git clone https://github.com/kouloumos/my-toolkit.git
cd my-toolkit
# Enter development environment
# (Squid is automatically allowed in dev mode)
nix develop
# Test scripts directly from source
my-toolkit list
my-toolkit health-check
my-toolkit torrent-search "Movie Name"
# Or run scripts without entering the shell
nix develop --command my-toolkit health-checkThis approach provides instant feedback - any changes you make to scripts are immediately available for testing without rebuilding your system.
The project includes a comprehensive testing framework:
# Run all tests (the Nix way)
nix flake check
# Run unit tests directly
python3 -m unittest tests/test_toolkit.py
# Run specific test class
python3 -m unittest tests.test_toolkit.TestProxyConfiguration
# Run with verbose output
python3 -m unittest tests/test_toolkit.py -v
# Health check (integration test)
my-toolkit health-check -vTest Categories:
- Unit tests: Configuration, utilities, script availability
- Integration tests: Proxy, network, services
- Syntax checks: Python and shell script validation
- Health checks: Live system verification
See CLAUDE.md for:
- Code conventions and patterns
- Testing requirements
- Documentation standards
- Nix-specific patterns
- Adding new features checklist
my-toolkit/
βββ shell_scripts/ # Shell script utilities
βββ python_scripts/ # Python-based utilities (with toolkit_utils.py)
βββ systemd_services/ # Systemd service definitions
βββ tests/ # Unit and integration tests
βββ default.nix # Main package definition
βββ flake.nix # Nix flake configuration (packages, apps, modules, checks)
βββ README.md # User-facing documentation
βββ CLAUDE.md # Development guide and conventions
- Add shell scripts to
shell_scripts/or Python scripts topython_scripts/ - Update
default.nixwith any new dependencies - Rebuild the package
This toolkit supports multiple distribution models to fit different use cases:
Perfect for testing or one-off usage:
nix run github:kouloumos/my-toolkit#torrent-search -- "Movie Name"- β Zero installation
- β All dependencies included
- β Works on any system with Nix
- β Can run specific commits/versions
For regular use without system integration:
nix profile install github:kouloumos/my-toolkit- β Persistent in your PATH
- β No system configuration needed
- β Easy to update/remove
For full system integration with services:
# In your NixOS configuration
imports = [ inputs.my-toolkit.nixosModules.default ];
my-toolkit.enable = true;
my-toolkit.services.media-renamer = true;- β System-wide availability
- β Systemd service integration
- β Declarative configuration
For developing the toolkit while having it system-integrated, use a local path input in your NixOS flake.nix:
inputs = {
my-toolkit = {
url = "path:/home/youruser/path/to/my-toolkit";
};
# ... your other inputs
};Then import the module as usual in configuration.nix. To pick up changes after editing scripts:
sudo nixos-rebuild switchNo need to update the flake lock β Nix re-evaluates the local path on each rebuild.
For contributing or testing changes:
nix develop
# Changes to scripts are immediately available- β Hot reload (no rebuilds)
- β Full development environment
- β All dependencies included
The flake app model makes it trivial to share tools with others:
# Share a one-liner that "just works"
nix run github:yourusername/my-toolkit#torrent-search -- "Movie"
# Or add to someone else's flake
inputs.my-toolkit.url = "github:yourusername/my-toolkit";This is the "nixiest" way to distribute tools - declarative, reproducible, and shareable!
MIT License