Skip to content

Commit

Permalink
feat: chezmoi post
Browse files Browse the repository at this point in the history
removed FOSS post for the moment
  • Loading branch information
theobori committed Mar 10, 2024
1 parent 6ef7a08 commit 637f1fd
Show file tree
Hide file tree
Showing 13 changed files with 177 additions and 8 deletions.
56 changes: 56 additions & 0 deletions posts/chezmoi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Manage dotfiles with chezmoi
date: "2024-03-10"
---

To give a bit of context, I had automated the deployment of the configuration of my Linux environment with an Ansible playbook ([repository](https://github.com/theobori/self-config)). This setup is compatible with almost all Linux distributions (probably UNIX too) but I was looking for something lighter and simpler.

 

I found by chance [chezmoi](https://chezmoi.io) which is able to manage dotfiles as well as some other configurations which could be linked to these dotfiles. The tool allows you to update files on several different machines, it's very complete, simple and effective.

Some people pair it with Ansible but I prefer to use the solution in a very simple way, with the tool's native features (scripting and templating).

 

Something interesting about [chezmoi](https://chezmoi.io) is that it supports file encryption with modern tools like [age](https://age-encryption.org). This is very useful for certain sensitive data such as SSH private keys. So you can add configuration so that the tool can encrypt and decrypt.

My configuration template looks like this (below) in the `.chezmoi.yaml.tmpl` file.

 

{% raw %}
```jinja2
{{ $has_age := false }}
{{ if stdinIsATTY }}
{{ $has_age = promptBool "do you have age " }}
{{ end }}
encryption: "age"
{{ if $has_age }}
age:
identity: "/home/nagi/.config/age/key.txt"
recipient: "age14m06fd3svs9neg2w97ccw3c8470hckl95qxr6jw8fgm4ex65352q6tun06"
{{ end }}
```
{% endraw %}
 

For the moment the repository is only compatible with Fedora only, however it is easy to implement other distributions.

## Apply from a different machine
 

To apply my configuration from another machine, simply run the following commands.

```bash
chezmoi init https://github.com/theobori/dotfiles.git
chezmoi apply -v
```

## Links

[https://github.com/theobori/dotfiles](https://github.com/theobori/dotfiles)

 
6 changes: 3 additions & 3 deletions posts/teeworlds-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Indirectly, other people use it, for example, to render skins in a Discord chann
</p>
&nbsp;

## Use cases
## Use case examples
&nbsp;
### Teeworlds skin rendering

Expand Down Expand Up @@ -72,8 +72,8 @@ try {
### Result (4K)

<p align="center" width="100%">
<img src="/render_color.png" width="30%" class="mr-40" >
<img src="/render_default.png" width="30%" class="ml-40" >
<img src="/render_default.png" width="30%" class="mr-20" >
<img src="/render_color.png" width="30%" class="ml-20" >
</p>

&nbsp;
Expand Down
File renamed without changes.
53 changes: 53 additions & 0 deletions public_gemini/chezmoi.gmi
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Manage dotfiles with chezmoi
## 2024-03-10
To give a bit of context, I had automated the deployment of the configuration of my Linux environment with an Ansible playbook (
=> https://github.com/theobori/self-config repository
). This setup is compatible with almost all Linux distributions (probably UNIX too) but I was looking for something lighter and simpler.

I found by chance
=> https://chezmoi.io chezmoi
which is able to manage dotfiles as well as some other configurations which could be linked to these dotfiles. The tool allows you to update files on several different machines, it's very complete, simple and effective.

Some people pair it with Ansible but I prefer to use the solution in a very simple way, with the tool's native features (scripting and templating).

Something interesting about
=> https://chezmoi.io chezmoi
is that it supports file encryption with modern tools like
=> https://age-encryption.org age
. This is very useful for certain sensitive data such as SSH private keys. So you can add configuration so that the tool can encrypt and decrypt.

My configuration template looks like this (below) in the .chezmoi.yaml.tmpl file.

{% raw %}

```jinja2
{{ $has_age := false }}

{{ if stdinIsATTY }}
{{ $has_age = promptBool "do you have age " }}
{{ end }}

encryption: "age"
{{ if $has_age }}
age:
identity: "/home/nagi/.config/age/key.txt"
recipient: "age14m06fd3svs9neg2w97ccw3c8470hckl95qxr6jw8fgm4ex65352q6tun06"
{{ end }}
```

{% endraw %}

For the moment the repository is only compatible with Fedora only, however it is easy to implement other distributions.

## Apply from a different machine

To apply my configuration from another machine, simply run the following commands.

```bash
chezmoi init https://github.com/theobori/dotfiles.git
chezmoi apply -v
```

## Links

=> https://github.com/theobori/dotfiles https://github.com/theobori/dotfiles
2 changes: 1 addition & 1 deletion public_gemini/index.gmi
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ I can be reached via Discord (b0th) or via nagi@cock.li.
=> gopher://tilde.pink:70/1/~nagi Gopher

## Posts
=> /~nagi/chezmoi.gmi Manage dotfiles with chezmoi - mar 2024
=> /~nagi/ebpf.gmi eBPF essentials - jan 2024
=> /~nagi/pubnix.gmi Public access UNIX systems - oct 2023
=> /~nagi/teeworlds.gmi Play Teeworlds through Docker - oct 2023
=> /~nagi/mozilla.gmi NGINX for Mozilla HTTP Observatory - oct 2023
=> /~nagi/tf-ovh.gmi Terraform OVH external DNS records - oct 2023
=> /~nagi/knockd_ufw.gmi OpenSSH port knocking with UFW - oct 2023
=> /~nagi/theoboricafe.gmi FOSS accessible services - sep 2023
=> /~nagi/teeworlds-utilities.gmi Teeworlds utilities - jul 2023
=> /~nagi/tf-neuvector.gmi Terraform NeuVector provider - jun 2023
=> /~nagi/tf-doom.gmi Terraform chaos engineering - jun 2023
Expand Down
2 changes: 1 addition & 1 deletion public_gemini/teeworlds-utilities.gmi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Indirectly, other people use it, for example, to render skins in a Discord chann
=> https://teeassembler.developer.li/ TeeAssembler 2.0
that used some part of the **teeworlds-utilites** code.

## Use cases
## Use case examples

### Teeworlds skin rendering

Expand Down
4 changes: 3 additions & 1 deletion public_gemini/tf-neuvector.gmi
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ resource "neuvector_service_config" "service_config_test" {

## Links

=> https://github.com/theobori/terraform-provider-neuvector https://github.com/theobori/terraform-provider-neuvector
=> https://github.com/theobori/terraform-provider-neuvector https://github.com/theobori/terraform-provider-neuvector

=> https://registry.terraform.io/providers/theobori/neuvector/latest https://registry.terraform.io/providers/theobori/neuvector
8 changes: 8 additions & 0 deletions public_gemini/websites.gmi
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ By losing myself on the Internet, I find some very interesting things, most of t
=> https://tmpout.sh/ tmpout.sh
*
=> https://n0.lol/ n0.lol
*
=> https://webzine.puffy.cafe/ webzine.puffy.cafe
*
=> https://www.analognowhere.com/ analognowhere.com
*
=> https://si3t.ch/ si3t.ch
*
=> https://why-openbsd.rocks/ why-openbsd.rocks

## Tor

Expand Down
36 changes: 36 additions & 0 deletions public_gopher/chezmoi.gph
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Manage dotfiles with chezmoi
2024-03-10
Last edit: 2024-03-10
---------------------

To give a bit of context, I had automated the deployment of the configuration of my Linux environment with an Ansible playbook (
[h|repository|URL:https://github.com/theobori/self-config|tilde.pink|70]
). This setup is compatible with almost all Linux distributions (probably UNIX too) but I was looking for something lighter and simpler.

I found by chance
[h|chezmoi|URL:https://chezmoi.io|tilde.pink|70]
which is able to manage dotfiles as well as some other configurations which could be linked to these dotfiles. The tool allows you to update files on several different machines, it's very complete, simple and effective.

Some people pair it with Ansible but I prefer to use the solution in a very simple way, with the tool's native features (scripting and templating).

Something interesting about
[h|chezmoi|URL:https://chezmoi.io|tilde.pink|70]
is that it supports file encryption with modern tools like [age](https://age-encryption.org). This is very useful for certain sensitive data such as SSH private keys. So you can add configuration so that the tool can encrypt and decrypt.

My configuration template looks like this (below) in the `.chezmoi.yaml.tmpl` file.

For the moment the repository is only compatible with Fedora only, however it is easy to implement other distributions.

## Apply from a different machine

To apply my configuration from another machine, simply run the following commands.

```bash
chezmoi init https://github.com/theobori/dotfiles.git
chezmoi apply -v
```

## Links

[h|https://github.com/theobori/dotfiles|URL:https://github.com/theobori/dotfiles|tilde.pink|70]

2 changes: 1 addition & 1 deletion public_gopher/index.gph
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ I can be reached via Discord (b0th) or via nagi@cock.li.
gemini://tilde.pink/~nagi

## Posts
[1|Manage dotfiles with chezmoi - mar 2024|/~nagi/chezmoi.gph|70]
[1|eBPF essentials - jan 2024|/~nagi/ebpf.gph|tilde.pink|70]
[1|Public access UNIX systems - oct 2023|/~nagi/pubnix.gph|tilde.pink|70]
[1|Play Teeworlds through Docker - oct 2023|/~nagi/teeworlds.gph|tilde.pink|70]
[1|NGINX for Mozilla HTTP Observatory - oct 2023|/~nagi/mozilla.gph|tilde.pink|70]
[1|Terraform OVH external DNS records - oct 2023|/~nagi/tf-ovh.gph|tilde.pink|70]
[1|OpenSSH port knocking with UFW - oct 2023|/~nagi/knockd_ufw.gph|tilde.pink|70]
[1|FOSS accessible services - sep 2023|/~nagi/theoboricafe.gph|tilde.pink|70]
[1|Teeworlds utilities - jul 2023|/~nagi/teeworlds-utilities.gph|tilde.pink|70]
[1|Terraform NeuVector provider - jun 2023|/~nagi/tf-neuvector.gph|tilde.pink|70]
[1|Terraform chaos engineering - jun 2023|/~nagi/tf-doom.gph|tilde.pink|70]
Expand Down
2 changes: 1 addition & 1 deletion public_gopher/teeworlds-utilities.gph
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Indirectly, other people use it, for example, to render skins in a Discord chann
[h|TeeAssembler 2.0|URL:https://teeassembler.developer.li/|tilde.pink|70]
that used some part of the **`teeworlds-utilites`** code.

## Use cases
## Use case examples

### Teeworlds skin rendering

Expand Down
2 changes: 2 additions & 0 deletions public_gopher/tf-neuvector.gph
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ resource "neuvector_service_config" "service_config_test" {

[h|https://github.com/theobori/terraform-provider-neuvector|URL:https://github.com/theobori/terraform-provider-neuvector|tilde.pink|70]

[h|https://registry.terraform.io/providers/theobori/neuvector|URL:https://registry.terraform.io/providers/theobori/neuvector/latest|tilde.pink|70]

12 changes: 12 additions & 0 deletions public_gopher/websites.gph
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ By losing myself on the Internet, I find some very interesting things, most of t
-
[h|n0.lol|URL:https://n0.lol/|tilde.pink|70]

-
[h|webzine.puffy.cafe|URL:https://webzine.puffy.cafe/|tilde.pink|70]

-
[h|analognowhere.com|URL:https://www.analognowhere.com/|tilde.pink|70]

-
[h|si3t.ch|URL:https://si3t.ch/|tilde.pink|70]

-
[h|why-openbsd.rocks|URL:https://why-openbsd.rocks/|tilde.pink|70]

## Tor

-
Expand Down

0 comments on commit 637f1fd

Please sign in to comment.