From 63402edd8fcf693a6f151889046cc03d37f53f30 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sun, 27 Jul 2025 23:55:03 +0200 Subject: [PATCH] Manage termscp config with nix --- flake.nix | 1 + modules/termscp.nix | 116 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 modules/termscp.nix diff --git a/flake.nix b/flake.nix index 2f938d0..5b1b444 100644 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,7 @@ ./modules/zsh.nix ./modules/ssh.nix ./modules/git.nix + ./modules/termscp.nix ]; home.username = "yanlin"; diff --git a/modules/termscp.nix b/modules/termscp.nix new file mode 100644 index 0000000..637eda4 --- /dev/null +++ b/modules/termscp.nix @@ -0,0 +1,116 @@ +{ pkgs, ... }: + +{ + home.file."Library/Application Support/termscp/config.toml".text = '' + # termscp configuration file + # Generated by Nix - see modules/termscp.nix for customization + + [ui] + # Default file transfer protocol (SFTP, SCP, FTP, FTPS) + default_protocol = "SFTP" + + # Text editor to use for file editing + text_editor = "nvim" + + # Show hidden files by default + show_hidden_files = true + + # Group directories in file explorer + # Options: "first", "last", "none" + group_dirs = "first" + + # Default local directory to start in + local_directory = "~" + + # Default remote directory to connect to + remote_directory = "/" + + # Enable file transfer progress notifications + show_progress = true + + # File transfer chunk size (in bytes) + transfer_chunk_size = 8192 + + [logging] + # Logging level: "OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" + level = "INFO" + + # Enable logging to file + enabled = true + + # Log file path (relative to config directory) + file_path = "termscp.log" + + # Maximum log file size in MB + max_size = 10 + + [notifications] + # Enable desktop notifications + enabled = true + + # Notify on successful transfer completion + on_transfer_completed = true + + # Notify on transfer failure + on_transfer_failed = true + + # Notify when updates are available + on_update_available = true + + # Minimum transfer size to trigger notifications (in bytes) + minimum_transfer_size = 1048576 # 1MB + + [security] + # SSH key file path for SFTP/SCP connections + ssh_key_path = "~/.ssh/id_rsa" + + # Enable strict host key checking + strict_host_key_checking = true + + # Connection timeout in seconds + connection_timeout = 30 + + # Enable compression for transfers + compression = true + + [display] + # Show file sizes in human readable format + human_readable_sizes = true + + # Show file modification timestamps + show_timestamps = true + + # Show file permissions + show_permissions = true + + # Date format for timestamps + # Options: "ISO", "US", "EUR", "CHN" + date_format = "ISO" + + # Time format for timestamps + time_format = "24H" + + [theme] + # Color scheme + color_scheme = "dark" + + # Enable syntax highlighting for text files + syntax_highlighting = true + + # Show borders in file explorer + show_borders = true + + [performance] + # Number of concurrent transfers + max_concurrent_transfers = 4 + + # Enable file caching for better performance + file_caching = true + + # Cache size limit in MB + cache_size_limit = 100 + + # Refresh interval for remote directory listings (in seconds) + refresh_interval = 300 + ''; +}