ディレクトリ構造
dotweaveが設定ファイルと同期データを保存する場所と構成について。
dotweaveが作成するものはすべて~/.config/dotweave/ディレクトリにまとまっています。dotweave initを実行すると、この構造が自動的に作成されます。
ディレクトリ~/.config/dotweave/
- settings.jsonc
- keys.txt
ディレクトリrepository/
- manifest.jsonc
ディレクトリdefault/
- .gitconfig
- .zshrc
ディレクトリ.config/
ディレクトリnvim/
- init.lua
ディレクトリwork/
ディレクトリ.config/
ディレクトリwork-tool/
- config.json
ディレクトリ.ssh/
- config.dotweave.secret
各ファイルの役割
Section titled “各ファイルの役割”repository/ — syncディレクトリ
Section titled “repository/ — syncディレクトリ”同期されたファイルを保持するGitリポジトリです。dotweave pushを実行するとファイルがここにコピーされ、dotweave pullを実行するとここからファイルが復元されます。GitHubなどのリモートにpushすることで、マシン間で同期できます。
repository/manifest.jsonc — 設定ファイル
Section titled “repository/manifest.jsonc — 設定ファイル”設定ファイルはすべての真実の源です。トラッキング中のすべてのファイルとディレクトリが、同期モード、プロファイル、パーミッションなどのオプションとともにリストされています。dotweave trackやdotweave untrackコマンドがこのファイルを更新します。
repository/default/ — defaultプロファイルのアーティファクト
Section titled “repository/default/ — defaultプロファイルのアーティファクト”特定のプロファイルに割り当てられていないファイルはここに保存されます。ほとんどのdotfileはここに配置されます。
repository/<profile>/ — 名前付きプロファイルのアーティファクト
Section titled “repository/<profile>/ — 名前付きプロファイルのアーティファクト”プロファイルを使用する場合、各プロファイルに専用のサブディレクトリが作られます。例えば、--profile workでトラッキングされたエントリはrepository/work/に保存されます。
keys.txt — ageのidentityファイル
Section titled “keys.txt — ageのidentityファイル”シークレットファイルの暗号化と復号に使うageプライベートキーです。dotweave initの実行時に作成され、AGE-SECRET-KEY-で始まります。
settings.jsonc — ユーザー設定
Section titled “settings.jsonc — ユーザー設定”アクティブなプロファイルやその他のローカル設定が保存されます。通常は直接編集する必要はなく、dotweave profile use workのようなコマンドが自動的に更新します。
manifest.jsoncの内容
Section titled “manifest.jsoncの内容”トラッキングエントリが数件ある場合の例です:
{ "version": 7, "age": { "recipients": ["age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"] }, "entries": [ { "kind": "file", "localPath": { "default": "~/.gitconfig" } }, { "kind": "directory", "localPath": { "default": "~/.config/nvim" } }, { "kind": "file", "localPath": { "default": "~/.ssh/config" }, "mode": { "default": "secret" }, "profiles": ["work"] } ]}設定ファイルの構造
Section titled “設定ファイルの構造”version— スキーマバージョン(現在は7)。dotweaveが自動的に管理します。age— 暗号化設定。recipients配列にはシークレットファイルの暗号化に使用する公開鍵がリストされています。entries— トラッキング中のファイルとディレクトリの一覧。各エントリには以下のフィールドがあります:kind—"file"または"directory"localPath— マシン上のファイルの場所(プラットフォーム別パス対応)repoPath— syncディレクトリ内のカスタムパス(省略可。デフォルトではlocalPathから自動生成)mode— 同期モード:"normal"、"secret"、"ignore"(省略可。デフォルトは"normal")profiles— このエントリが属するプロファイル(省略可。省略時はグローバル)permission—"0600"のような8進数のファイルパーミッション(省略可)