refactor: initial commit

This commit is contained in:
Ben Grande 2023-11-13 14:33:28 +00:00
commit f6ac229306
No known key found for this signature in database
GPG key ID: 00C64E14F51F9E56
594 changed files with 18600 additions and 0 deletions

View file

@ -0,0 +1,35 @@
# zsh
Zsh environment in Qubes OS.
## Table of Contents
* [Description](#description)
* [Installation](#installation)
* [Usage](#usage)
## Description
Install Zsh, setup it to be the user shell and touch ~/.zshrc to avoid
warnings.
## Installation
- Top
```sh
qubesctl top.enable utils.tools.zsh
qubesctl --targets=TARGET state.apply
qubesctl top.disable utils.tools.zsh
```
- State
<!-- pkg:begin:post-install -->
```sh
qubesctl --skip-dom0 --targets=TEMPLATEVMS state.apply utils.tools.zsh.change-shell
qubesctl --skip-dom0 --targets=APPVMS state.apply utils.tools.zsh.touch-zshrc
```
<!-- pkg:end:post-install -->
## Usage
Standard Zsh usage. No extra configuration required.

View file

@ -0,0 +1,20 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% if grains['nodename'] != 'dom0' -%}
include:
- .install
## chsh is not in Fedora and usermod covers a wider range.
"{{ slsdotpath }}-change-user-shell-to-zsh":
cmd.run:
- name: usermod -s /bin/zsh user
- runas: root
- require:
- sls: {{ slsdotpath }}.install
{% endif -%}

View file

@ -0,0 +1,9 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'*':
- utils.tools.zsh.change-shell

View file

@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
include:
- .install
- .touch-zshrc
- .change-shell

View file

@ -0,0 +1,11 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'*':
- utils.tools.zsh.touch-zshrc
- utils.tools.zsh.install
- utils.tools.zsh.change-shell

View file

@ -0,0 +1,26 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% if grains['nodename'] != 'dom0' -%}
include:
- .touch-zshrc
"{{ slsdotpath }}-updated":
pkg.uptodate:
- refresh: True
"{{ slsdotpath }}-installed":
pkg.installed:
- refresh: True
- install_recommends: False
- skip_suggestions: True
- pkgs:
- zsh
- zsh-autosuggestions
- zsh-syntax-highlighting
{% endif -%}

View file

@ -0,0 +1,9 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'*':
- utils.tools.zsh.install

View file

@ -0,0 +1,16 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
# zsh complains if there is no .zshrc when.
# Only useful if not using the dotfiles but installing zsh.
"{{ slsdotpath }}-touch-home-zshrc":
file.touch:
- name: /home/user/.zshrc
"{{ slsdotpath }}-touch-skel-zshrc":
file.touch:
- name: /etc/skel/.zshrc

View file

@ -0,0 +1,9 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
base:
'*':
- utils.tools.zsh.touch-zshrc