diff --git a/salt/debian-xfce/README.md b/salt/debian-xfce/README.md new file mode 100644 index 00000000..6cf587be --- /dev/null +++ b/salt/debian-xfce/README.md @@ -0,0 +1,34 @@ +# debian + +Debian Xfce Template in Qubes OS. + +## Table of Contents + +* [Description](#description) +* [Installation](#installation) +* [Usage](#usage) + +## Description + +Creates the Debian Xfce Template as well as a Disposable Template based on it. + +## Installation + +- Top: +```sh +qubesctl top.enable debian-xfce +qubesctl --targets=debian-12-xfce state.apply +qubesctl top.disable debian-xfce +``` + +- State: + +```sh +qubesctl state.apply debian-xfce.create +qubesctl --skip-dom0 --targets=debian-12-xfce state.apply debian-xfce.install +``` + + +## Usage + +AppVMs and StandaloneVMs can be based on this template. diff --git a/salt/debian-xfce/clone.sls b/salt/debian-xfce/clone.sls new file mode 100644 index 00000000..5ffbb274 --- /dev/null +++ b/salt/debian-xfce/clone.sls @@ -0,0 +1,12 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{%- import slsdotpath ~ "/template.jinja" as template -%} + +"{{ template.template }}-template-installed": + qvm.template_installed: + - name: {{ template.template }} + - fromrepo: {{ template.repo }} diff --git a/salt/debian-xfce/clone.top b/salt/debian-xfce/clone.top new file mode 100644 index 00000000..4e9a9209 --- /dev/null +++ b/salt/debian-xfce/clone.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'dom0': + - match: nodegroup + - debian-xfce.clone diff --git a/salt/debian-xfce/create.sls b/salt/debian-xfce/create.sls new file mode 100644 index 00000000..075f5a36 --- /dev/null +++ b/salt/debian-xfce/create.sls @@ -0,0 +1,62 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{%- from "qvm/template.jinja" import load -%} + +{%- import slsdotpath ~ "/template.jinja" as template -%} + +include: + - .clone + +"dvm-{{ template.template }}-absent": + qvm.absent: + - names: + - {{ template.template_clean }}-dvm + - {{ template.template }}-dvm + +{% load_yaml as defaults -%} +name: dvm-{{ template.template_clean }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- template: {{ template.template }} +- label: red +prefs: +- template: {{ template.template }} +- label: red +- memory: 300 +- maxmem: 800 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} + +{% load_yaml as defaults -%} +name: {{ template.template }} +force: True +require: +- sls: {{ slsdotpath }}.clone +present: +- label: black +prefs: +- label: black +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- include_in_backups: False +features: +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} diff --git a/salt/debian-xfce/create.top b/salt/debian-xfce/create.top new file mode 100644 index 00000000..9608cad0 --- /dev/null +++ b/salt/debian-xfce/create.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'dom0': + - match: nodegroup + - debian-xfce.create diff --git a/salt/debian-xfce/init.top b/salt/debian-xfce/init.top new file mode 100644 index 00000000..6c909093 --- /dev/null +++ b/salt/debian-xfce/init.top @@ -0,0 +1,13 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'dom0': + - match: nodegroup + - debian-xfce.create + 'I@qubes:type:template and E@^debian-[0-9][0-9]-xfce$': + - match: compound + - debian-xfce.install diff --git a/salt/debian-xfce/install.sls b/salt/debian-xfce/install.sls new file mode 100644 index 00000000..41e39436 --- /dev/null +++ b/salt/debian-xfce/install.sls @@ -0,0 +1,13 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{% if grains['nodename'] != 'dom0' -%} + +"{{ slsdotpath }}-updated": + pkg.uptodate: + - refresh: True + +{% endif %} diff --git a/salt/debian-xfce/install.top b/salt/debian-xfce/install.top new file mode 100644 index 00000000..443f64d7 --- /dev/null +++ b/salt/debian-xfce/install.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'I@qubes:type:template and E@^debian-[0-9][0-9]-xfce$': + - match: compound + - debian-xfce.install diff --git a/salt/debian-xfce/template.jinja b/salt/debian-xfce/template.jinja new file mode 100644 index 00000000..617c2f75 --- /dev/null +++ b/salt/debian-xfce/template.jinja @@ -0,0 +1,15 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{% set base = 'debian' -%} +{% set version = salt['pillar.get']('qvm:debian:version', '12') -%} +{% set flavor = 'xfce' -%} +{% set repo = salt['pillar.get']('qvm:debian:repo', 'qubes-templates-itl') -%} +{% if flavor -%} + {% set flavor = '-' ~ flavor -%} +{% endif -%} +{% set template = base ~ '-' ~ version ~ flavor -%} +{% set template_clean = base ~ flavor -%} diff --git a/salt/debian/template.jinja b/salt/debian/template.jinja index c3f44322..54365ea4 100644 --- a/salt/debian/template.jinja +++ b/salt/debian/template.jinja @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% set base = 'debian' -%} {% set version = salt['pillar.get']('qvm:debian:version', '12') -%} -{% set flavor = salt['pillar.get']('qvm:debian:flavor', 'xfce') -%} +{% set flavor = '' -%} {% set repo = salt['pillar.get']('qvm:debian:repo', 'qubes-templates-itl') -%} {% if flavor -%} {% set flavor = '-' ~ flavor -%} diff --git a/salt/fedora-xfce/README.md b/salt/fedora-xfce/README.md new file mode 100644 index 00000000..1187f252 --- /dev/null +++ b/salt/fedora-xfce/README.md @@ -0,0 +1,34 @@ +# fedora + +Fedora Xfce Template in Qubes OS. + +## Table of Contents + +* [Description](#description) +* [Installation](#installation) +* [Usage](#usage) + +## Description + +Creates the Fedora Xfce template as well as a Disposable Template based on it. + +## Installation + +- Top: +```sh +qubesctl top.enable fedora-xfce +qubesctl --targets=fedora-38-xfce state.apply +qubesctl top.disable fedora-xfce +``` + +- State: + +```sh +qubesctl state.apply fedora-xfce.create +qubesctl --skip-dom0 --targets=fedora-38-xfce state.apply fedora-xfce.install +``` + + +## Usage + +AppVMs and StandaloneVMs can be based on this template. diff --git a/salt/fedora-xfce/clone.sls b/salt/fedora-xfce/clone.sls new file mode 100644 index 00000000..5ffbb274 --- /dev/null +++ b/salt/fedora-xfce/clone.sls @@ -0,0 +1,12 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{%- import slsdotpath ~ "/template.jinja" as template -%} + +"{{ template.template }}-template-installed": + qvm.template_installed: + - name: {{ template.template }} + - fromrepo: {{ template.repo }} diff --git a/salt/fedora-xfce/clone.top b/salt/fedora-xfce/clone.top new file mode 100644 index 00000000..4f92694b --- /dev/null +++ b/salt/fedora-xfce/clone.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'dom0': + - match: nodegroup + - fedora-xfce.clone diff --git a/salt/fedora-xfce/create.sls b/salt/fedora-xfce/create.sls new file mode 100644 index 00000000..1e26bd3f --- /dev/null +++ b/salt/fedora-xfce/create.sls @@ -0,0 +1,62 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{%- from "qvm/template.jinja" import load -%} + +{%- import slsdotpath ~ "/template.jinja" as template -%} + +include: + - .clone + +"dvm-{{ template.template }}-absent": + qvm.absent: + - names: + - {{ template.template_clean }}-dvm + - {{ template.template }}-dvm + +{% load_yaml as defaults -%} +name: dvm-{{ template.template_clean }} +force: True +require: +- sls: {{ template.template_clean }}.clone +present: +- template: {{ template.template }} +- label: red +prefs: +- template: {{ template.template }} +- label: red +- memory: 300 +- maxmem: 400 +- vcpus: 1 +- template_for_dispvms: True +- include_in_backups: False +features: +- enable: + - appmenus-dispvm +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} + +{% load_yaml as defaults -%} +name: {{ template.template }} +force: True +require: +- sls: {{ template.template_clean }}.clone +present: +- label: black +prefs: +- label: black +- memory: 300 +- maxmem: 600 +- vcpus: 1 +- include_in_backups: False +features: +- set: + - menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "qubes-open-file-manager.desktop qubes-run-terminal.desktop qubes-start.desktop" +{%- endload %} +{{ load(defaults) }} diff --git a/salt/fedora-xfce/create.top b/salt/fedora-xfce/create.top new file mode 100644 index 00000000..bded8fce --- /dev/null +++ b/salt/fedora-xfce/create.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'dom0': + - match: nodegroup + - fedora-xfce.create diff --git a/salt/fedora-xfce/init.top b/salt/fedora-xfce/init.top new file mode 100644 index 00000000..bc944647 --- /dev/null +++ b/salt/fedora-xfce/init.top @@ -0,0 +1,13 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'dom0': + - match: nodegroup + - fedora-xfce.create + 'I@qubes:type:template and E@^fedora-[0-9][0-9]-xfce$': + - match: compound + - fedora-xfce.install diff --git a/salt/fedora-xfce/install.sls b/salt/fedora-xfce/install.sls new file mode 100644 index 00000000..41e39436 --- /dev/null +++ b/salt/fedora-xfce/install.sls @@ -0,0 +1,13 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{% if grains['nodename'] != 'dom0' -%} + +"{{ slsdotpath }}-updated": + pkg.uptodate: + - refresh: True + +{% endif %} diff --git a/salt/fedora-xfce/install.top b/salt/fedora-xfce/install.top new file mode 100644 index 00000000..2740b238 --- /dev/null +++ b/salt/fedora-xfce/install.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'I@qubes:type:template and E@^fedora-[0-9][0-9]-xfce$': + - match: compound + - fedora-xfce.install diff --git a/salt/fedora-xfce/template.jinja b/salt/fedora-xfce/template.jinja new file mode 100644 index 00000000..ea9b39fe --- /dev/null +++ b/salt/fedora-xfce/template.jinja @@ -0,0 +1,15 @@ +{# +SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{% set base = 'fedora' -%} +{% set version = salt['pillar.get']('qvm:fedora:version', '38') -%} +{% set flavor = 'xfce' -%} +{% set repo = salt['pillar.get']('qvm:fedora:repo', 'qubes-templates-itl') -%} +{% if flavor -%} + {% set flavor = '-' ~ flavor -%} +{% endif -%} +{% set template = base ~ '-' ~ version ~ flavor -%} +{% set template_clean = base ~ flavor -%} diff --git a/salt/fedora/template.jinja b/salt/fedora/template.jinja index 6228ee91..ea59c513 100644 --- a/salt/fedora/template.jinja +++ b/salt/fedora/template.jinja @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% set base = 'fedora' -%} {% set version = salt['pillar.get']('qvm:fedora:version', '38') -%} -{% set flavor = salt['pillar.get']('qvm:fedora:flavor', 'xfce') -%} +{% set flavor = '' -%} {% set repo = salt['pillar.get']('qvm:fedora:repo', 'qubes-templates-itl') -%} {% if flavor -%} {% set flavor = '-' ~ flavor -%}