@@ -63,14 +63,14 @@ Manage an existing file with `chezmoi`:
6363
6464 $ chezmoi add ~/.bashrc
6565
66- This will create a directory called ` ~/.chezmoi ` with permissions ` 0600 ` where
67- ` chezmoi ` will store its state, if it does not already exist, and copy
68- ` ~/.bashrc ` to ` ~/.chezmoi/dot_bashrc ` .
66+ This will create a directory called ` ~/.local/share/ chezmoi ` with permissions
67+ ` 0600 ` where ` chezmoi ` will store its state, if it does not already exist, and
68+ copy ` ~/.bashrc ` to ` ~/.local/share/ chezmoi/dot_bashrc ` .
6969
70- You should manage your ` ~/.chezmoi ` directory with the version control system
71- of your choice. ` chezmoi ` will ignore all files and directories beginning with
72- a ` . ` in this directory, so directories like ` .git ` and ` .hg ` will not pollute
73- your home directory.
70+ You should manage your ` ~/.local/share/ chezmoi ` directory with the version
71+ control system of your choice. ` chezmoi ` will ignore all files and directories
72+ beginning with a ` . ` in this directory, so directories like ` .git ` and ` .hg `
73+ will not pollute your home directory.
7474
7575Edit the desired state:
7676
@@ -119,16 +119,17 @@ Whereas at work it might be:
119119 name = John Smith
120120 email = john@company.com
121121
122- To handle this, on each machine create a file called ` ~/.chezmoi.yaml ` defining
123- what might change. For your home machine:
122+ To handle this, on each machine create a file called
123+ ` ~/.config/chezmoi/chezmoi.yaml ` defining what might change. For your home
124+ machine:
124125
125126 data:
126127 name: John Smith
127128 email: john@home.org
128129
129- If you intend to store private data (e.g. access tokens) in ` ~/.chezmoi.yaml ` ,
130- make sure it has permissions ` 0600 ` . See "Keeping data private" below for more
131- discussion on this.
130+ If you intend to store private data (e.g. access tokens) in
131+ ` ~/.config/chezmoi/chezmoi.yaml ` , make sure it has permissions ` 0600 ` . See
132+ "Keeping data private" below for more discussion on this.
132133
133134If you prefer, you can use any format supported by
134135[ Viper] ( https://github.com/spf13/viper ) for your configuration file. This
@@ -140,7 +141,7 @@ it in to a template:
140141 $ chezmoi add -T ~/.gitconfig
141142
142143You can then open the template (which will be saved in the file
143- ` ~/.chezmoi/dot_gitconfig.tmpl ` ):
144+ ` ~/.local/share/ chezmoi/dot_gitconfig.tmpl ` ):
144145
145146 $ chezmoi edit ~/.gitconfig
146147
@@ -151,7 +152,8 @@ The file should look something like:
151152 email = {{ .email }}
152153
153154` chezmoi ` will substitute the variables from the ` data ` section of your
154- ` ~/.chezmoi.yaml ` file when calculating the desired state of ` .gitconfig ` .
155+ ` ~/.config/chezmoi/chezmoi.yaml ` file when calculating the desired state of
156+ ` .gitconfig ` .
155157
156158For more advanced usage, you can use the full power of the
157159[ ` text/template ` ] ( https://godoc.org/text/template ) language to include or
@@ -167,7 +169,7 @@ populated variables:
167169| ` chezmoi.os ` | Operating system, e.g. ` darwin ` , ` linux ` , etc. as returned by [ runtime.GOOS] ( https://godoc.org/runtime#pkg-constants ) . |
168170| ` chezmoi.username ` | The username of the user running ` chezmoi ` . |
169171
170- For example, in your ` ~/.chezmoi/dot_bashrc.tmpl ` you might have:
172+ For example, in your ` ~/.local/share/ chezmoi/dot_bashrc.tmpl ` you might have:
171173
172174 # common config
173175 export EDITOR=vi
@@ -187,16 +189,16 @@ to give it an `empty_` prefix. See "Under the hood" below.
187189
188190` chezmoi ` automatically detects when files and directories are private when
189191adding them by inspecting their permissions. Private files and directories are
190- stored in ` ~/.chezmoi ` as regular, public files with permissions ` 0644 ` and the
191- name prefix ` private_ ` . For example:
192+ stored in ` ~/.local/share/ chezmoi ` as regular, public files with permissions
193+ ` 0644 ` and the name prefix ` private_ ` . For example:
192194
193195 $ chezmoi add ~/.netrc
194196
195- will create ` ~/.chezmoi/private_dot_netrc ` (assuming ` ~/.netrc ` is not world-
196- or group- readable, as it should be). This file is still private because
197- ` ~/.chezmoi ` is not group- or world- readable or executable. ` chezmoi ` checks
198- that the permissions of ` ~/.chezmoi ` are ` 0700 ` on every run and will print a
199- warning if they are not.
197+ will create ` ~/.local/share/ chezmoi/private_dot_netrc ` (assuming ` ~/.netrc ` is
198+ not world- or group- readable, as it should be). This file is still private
199+ because ` ~/.local/share/ chezmoi ` is not group- or world- readable or
200+ executable. ` chezmoi ` checks that the permissions of ` ~/.local/share/ chezmoi `
201+ are ` 0700 ` on every run and will print a warning if they are not.
200202
201203It is common that you need to store access tokens in config files, e.g. a
202204[ Github access
@@ -206,16 +208,17 @@ your machine.
206208
207209### Using templates variables
208210
209- Typically, ` ~/.chezmoi.yaml ` is not checked in to version control and has
210- permissions 0600. You can store tokens as template values in the ` data `
211- section. For example, if your ` ~/.chezmoi.yaml ` contains:
211+ Typically, ` ~/.config/chezmoi/chezmoi.yaml ` is not checked in to version
212+ control and has permissions 0600. You can store tokens as template values in
213+ the ` data ` section. For example, if your ` ~/.config/chezmoi/chezmoi.yaml `
214+ contains:
212215
213216 data:
214217 github:
215218 user: <your-github-username>
216219 token: <your-github-token>
217220
218- Your ` ~/.chezmoi/private_dot_gitconfig.tmpl ` can then contain:
221+ Your ` ~/.local/share/ chezmoi/private_dot_gitconfig.tmpl ` can then contain:
219222
220223 {{- if .github }}
221224 [github]
@@ -285,20 +288,22 @@ You can query the keyring from the command line:
285288` chezmoi ` takes a ` -c ` flag specifying the file to read its configuration from.
286289You can encrypt your configuration and then only decrypt it when needed:
287290
288- $ gpg -d ~/.chezmoi.yaml.gpg | chezmoi -c /dev/stdin apply
291+ $ gpg -d ~/.config/chezmoi/ chezmoi.yaml.gpg | chezmoi -c /dev/stdin apply
289292
290293
291294## Managing your ` ~/.chezmoi ` directory with version control
292295
293296` chezmoi ` has some helper commands to assist managing your source directory
294297with version control. The default version control system is ` git ` but you can
295- change this by setting ` sourceVCSCommand ` in your ` .chezmoi.yaml ` file, for
296- example, if you want to use Mercurial:
298+ change this by setting ` sourceVCSCommand ` in your
299+ ` ~/.config/chezmoi/chezmoi.yaml ` file, for example, if you want to use
300+ Mercurial:
297301
298302 sourceVCSCommand: hg
299303
300304` chezmoi source ` is then a shortcut to running ` sourceVCSCommand ` in your
301- ` ~/.chezmoi ` directory. For example you can push the current branch with:
305+ ` ~/.local/share/chezmoi ` directory. For example you can push the current branch
306+ with:
302307
303308 $ chezmoi source push
304309
@@ -310,6 +315,13 @@ stop `chezmoi` from interpreting extra flags. For example:
310315The ` source ` command accepts the usual ` -n ` and ` -v ` flags, so you can see
311316exactly what it will run without executing it.
312317
318+ As a shortcut,
319+
320+ $ chezmoi cd
321+
322+ starts a shell in your source directory, which can be very useful when
323+ performing multiple VCS operations.
324+
313325
314326## Importing archives
315327
@@ -343,11 +355,11 @@ which lists all the files in the target state.
343355## Under the hood
344356
345357` chezmoi ` stores the desired state of files, symbolic links, and directories in
346- regular files and directories in ` ~/.chezmoi ` . This location can be overridden
347- with the ` -s ` flag or by giving a value for ` sourceDir ` in ` ~/.chezmoi.yaml ` .
348- Some state is encoded in the source names. ` chezmoi ` ignores all files and
349- directories in the source directory that begin with a ` . ` . The following
350- prefixes and suffixes are special.
358+ regular files and directories in ` ~/.local/share/ chezmoi ` . This location can be
359+ overridden with the ` -s ` flag or by giving a value for ` sourceDir ` in
360+ ` ~/.config/chezmoi/chezmoi.yaml ` . Some state is encoded in the source names.
361+ ` chezmoi ` ignores all files and directories in the source directory that begin
362+ with a ` . ` . The following prefixes and suffixes are special.
351363
352364| Prefix | Effect |
353365| -------------------- | ----------------------------------------------------------------------------------|
@@ -374,9 +386,9 @@ Different target types allow different prefixes and suffixes.
374386
375387` chezmoi ` , by default, operates on your home directory, but this can be
376388overridden with the ` --target ` command line flag or by specifying ` targetDir `
377- in your ` ~/.chezmoi.yaml ` . In theory, you could use ` chezmoi ` to manage any
378- aspect of your filesystem. That said, although you can do this, you probably
379- shouldn't. Existing configuration management tools like
389+ in your ` ~/.config/ chezmoi/chezmoi .yaml ` . In theory, you could use ` chezmoi ` to
390+ manage any aspect of your filesystem. That said, although you can do this, you
391+ probably shouldn't. Existing configuration management tools like
380392[ Puppet] ( https://puppet.com/ ) , [ Chef] ( https://www.chef.io/chef/ ) ,
381393[ Ansible] ( https://www.ansible.com/ ) , and [ Salt] ( https://www.saltstack.com/ ) are
382394much better suited to whole system configuration management.
0 commit comments