refactor: initial commit

This commit is contained in:
Ben Grande 2023-11-13 14:33:28 +00:00
commit 5eebd789ed
591 changed files with 18598 additions and 0 deletions

View file

@ -0,0 +1,29 @@
# builder
Build tools for packaging in Qubes OS.
## Table of Contents
* [Description](#description)
* [Installation](#installation)
* [Usage](#usage)
## Description
This is not necessary for qubes-builder, it is just a set of useful tools for
building packages in UNIX distributions.
## Installation
Install builder tools on templates:
```sh
qubesctl --skip-dom0 --targets=TEMPLATEVMS state.apply utils.tools.builder.core
```
Install documentation tools on templates:
```sh
qubesctl --skip-dom0 --targets=TEMPLATEVMS state.apply utils.tools.builder.doc
```
## Usage
Standard builder usage, no extra configuration required.

View file

@ -0,0 +1,46 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% if grains['nodename'] != 'dom0' -%}
"{{ slsdotpath }}-core-updated":
pkg.uptodate:
- refresh: True
"{{ slsdotpath }}-core-installed":
pkg.installed:
- refresh: True
- install_recommends: False
- skip_suggestions: True
- pkgs:
- qubes-core-agent-networking
- qubes-core-agent-passwordless-root
- bash-completion
- make
- rpmlint
- rpm
- licensecheck
- devscripts
{% set pkg = {
'Debian': {
'pkg': ['equivs', 'dctrl-tools', 'build-essential' 'debhelper', 'quilt',
'lintian', 'mmdebstrap'],
},
'RedHat': {
'pkg': ['rpmdevtools', 'rpm-sign', 'rpm-build', 'fedora-packager',
'fedora-review'],
},
}.get(grains.os_family) -%}
"{{ slsdotpath }}-core-installed-os-specific":
pkg.installed:
- refresh: True
- install_recommends: False
- skip_suggestions: True
- pkgs: {{ pkg.pkg|sequence|yaml }}
{% endif -%}

View file

@ -0,0 +1,25 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
SPDX-License-Identifier: AGPL-3.0-or-later
#}
{% if grains['nodename'] != 'dom0' -%}
"{{ slsdotpath }}-doc-updated":
pkg.uptodate:
- refresh: True
"{{ slsdotpath }}-doc-installed":
pkg.installed:
- refresh: True
- install_recommends: False
- skip_suggestions: True
- pkgs:
- pandoc
- ronn
- groff
- man-db
- less
{% endif -%}

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