-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow to exclude dotfiles on pillar data
- Loading branch information
1 parent
7e2502b
commit be5f119
Showing
14 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
<!-- | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
SPDX-License-Identifier: CC-BY-SA-4.0 | ||
--> | ||
|
@@ -13,6 +14,7 @@ Dotfiles. | |
* [Description](#description) | ||
* [Installation](#installation) | ||
* [Salt](#salt) | ||
* [Pillar](#pillar) | ||
* [Script](#script) | ||
* [Usage](#usage) | ||
* [License](#license) | ||
|
@@ -59,6 +61,48 @@ Install specific files in Dom0: | |
sudo qubesctl state.apply dotfiles.copy-dom0,dotfiles.copy-sh,dotfiles.copy-vim,dotfiles.copy-x11 | ||
``` | ||
|
||
#### Pillar | ||
|
||
With salt, each state execution can be opt out by topic via a corresponding | ||
pillar set to a non true value (eg: Setting qusal:dotfiles:dom0 to false will | ||
disable states specific to dom0, setting qusal:dotfiles:git to false will | ||
disable states specific to git). | ||
|
||
You will need a top file and a sls file in your pillar_roots, when following | ||
[the Qusal's installation instructions](https://github.com/ben-grande/qusal/blob/main/docs/INSTALL.md), | ||
`/srv/pillar/qusal` will be added to you pillar_roots. | ||
|
||
By default, the formulas assume that you opt-in for all dotfiles. | ||
|
||
Example: /srv/pillar/qusal/dotfiles.top: | ||
|
||
```yaml | ||
base: | ||
'*': | ||
- qusal.dotfiles | ||
``` | ||
It will apply the qusal/dotfiles sls to all targets. | ||
Example: /srv/pillar/qusal/dotfiles.sls containing the data to pass to the | ||
targets: | ||
```yaml | ||
qusal: | ||
dotfiles: | ||
dom0: false | ||
``` | ||
It will disable the dom0 dotfiles configuration. | ||
Enable the pillar top above: | ||
```sh | ||
sudo qubesctl top.enable qusal.dotfiles pillar=true | ||
``` | ||
|
||
Now subsequent calls to the states of this repository will skip copy-dom0. | ||
|
||
### Script | ||
|
||
You can simply deploy all configurations with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if salt['pillar.get']('qusal:dotfiles:all', default=true) == true -%} | ||
|
||
include: | ||
- .copy-dom0 | ||
- .copy-git | ||
|
@@ -17,6 +20,8 @@ include: | |
- .copy-x11 | ||
- .copy-xfce | ||
|
||
{%- endif -%} | ||
|
||
{# | ||
Unfortunately salt.states.file does not keep permissions when using salt-ssh. | ||
Best option is 'file.managed mode: keep' or 'file.recurse file_mode: keep'. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:dom0', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-dom0-home": | ||
|
@@ -25,3 +29,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- user: root | ||
- group: root | ||
- makedirs: True | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:git', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-git-home": | ||
|
@@ -65,3 +69,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- mode: '0755' | ||
- recurse: | ||
- mode | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:gtk', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-gtk-home": | ||
|
@@ -23,3 +27,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0700' | ||
- user: root | ||
- group: root | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:mutt', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-mutt-home": | ||
|
@@ -25,3 +29,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- user: root | ||
- group: root | ||
- makedirs: True | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:net', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-net-home": | ||
|
@@ -27,3 +31,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- group: root | ||
- keep_symlinks: True | ||
- force_symlinks: True | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:gpg', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-pgp-home": | ||
|
@@ -23,3 +27,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0700' | ||
- user: root | ||
- group: root | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:sh', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-sh-home": | ||
|
@@ -43,3 +47,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0755' | ||
- recurse: | ||
- mode | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:ssh', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-ssh-home": | ||
|
@@ -24,3 +28,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0700' | ||
- user: root | ||
- group: root | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:tmux', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-tmux-home": | ||
|
@@ -37,3 +41,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- mode: '0755' | ||
- recurse: | ||
- mode | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:vim', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-vim-home": | ||
|
@@ -23,3 +27,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- dir_mode: '0700' | ||
- user: root | ||
- group: root | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:x11', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-x11-home": | ||
|
@@ -27,3 +31,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- group: root | ||
- keep_symlinks: True | ||
- force_symlinks: True | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2024 seven-beep <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{%- if ( (salt['pillar.get']('qusal:dotfiles:all', default=true) == true ) | ||
and (salt['pillar.get']('qusal:dotfiles:xfce', default=true) == true )) -%} | ||
|
||
{%- import "dom0/gui-user.jinja" as gui_user -%} | ||
"{{ slsdotpath }}-copy-xfce-home": | ||
|
@@ -27,3 +31,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later | |
- group: root | ||
- keep_symlinks: True | ||
- force_symlinks: True | ||
{%- endif %} |