mirror of
https://github.com/flancian/garden.git
synced 2026-08-07 15:06:19 +00:00
autopushed
This commit is contained in:
+13
-1
@@ -5,6 +5,7 @@
|
|||||||
- #start https://www.chezmoi.io/quick-start/
|
- #start https://www.chezmoi.io/quick-start/
|
||||||
- #push [[2022-05-26]]
|
- #push [[2022-05-26]]
|
||||||
- [[refusing to merge unrelated histories]]
|
- [[refusing to merge unrelated histories]]
|
||||||
|
- See update below for the TLDR on how to use templates.
|
||||||
|
|
||||||
Example from my initial upload:
|
Example from my initial upload:
|
||||||
|
|
||||||
@@ -44,5 +45,16 @@ git commit -a -m "chezmoi from $HOSTNAME"
|
|||||||
git push
|
git push
|
||||||
```
|
```
|
||||||
|
|
||||||
[[Chezmoi]] supports [[templates]] to special-case files depending on the host they're being installed in, but I haven't experimented with them yet.
|
[[Chezmoi]] supports [[templates]] to special-case files depending on the host they're being installed in.
|
||||||
|
|
||||||
|
To apply a template to an already tracked file, e.g. .config/sway/config (in my case):
|
||||||
|
|
||||||
|
```
|
||||||
|
chezmoi chattr +template .config/sway/config
|
||||||
|
chezmoi edit .config/sway/config
|
||||||
|
```
|
||||||
|
|
||||||
|
Then use template syntax (see https://www.chezmoi.io/user-guide/templating/#simple-logic for the gist of it if you're interested in per-hostname cases, which is what I was after) and then use `chezmoi apply` to "run" the template and produce the file in any host.
|
||||||
|
|
||||||
|
Note that you need to edit the file with chezmoi edit every time essentially, unless you intend to get conflicts later. It seems like a fair tradeoff to me.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user