From c3937e881e4c6973dbe8338f1faf05a1e5556350 Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Sun, 14 Jan 2024 14:05:17 +0100 Subject: [PATCH] fix: disposable sys-audio name with disp prefix --- .reuse/dep5 | 6 +-- README.md | 2 +- salt/sys-audio/README.md | 20 +++++----- salt/sys-audio/configure-dvm.sls | 2 +- salt/sys-audio/configure-dvm.top | 5 +-- salt/sys-audio/create.sls | 13 +++--- .../files/admin/policy/default.policy | 40 +++++++++---------- salt/sys-audio/install.top | 3 +- 8 files changed, 44 insertions(+), 47 deletions(-) diff --git a/.reuse/dep5 b/.reuse/dep5 index c51f896..1a5dd99 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -5,13 +5,9 @@ Source: https://github.com/ben-grande/qusal Files: BOOTSTRAP.md CONTRIBUTING.md README.md */README.md .github/ISSUE_TEMPLATE/* -Copyright: 2023 Benjamin Grande M. S. +Copyright: 2023 - 2024 Benjamin Grande M. S. License: CC-BY-SA-4.0 -Files: */rc.local -Copyright: 2023 Benjamin Grande M. S. -License: GPL-3.0-or-later - Files: salt/sys-mirage-firewall/files/admin/mirage-firewall.tar.bz2 salt/sys-mirage-firewall/files/admin/mirage-firewall.sha256 salt/sys-mirage-firewall/files/admin/version.txt diff --git a/README.md b/README.md index dc5c27b..03d9dc0 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Qubes global settings (qubes-prefs) that will be managed: - **default_netvm**: sys-pihole, sys-firewall or disp-sys-firewall - **management_dispvm**: dvm-mgmt - **updatevm**: sys-pihole, sys-firewall or disp-sys-firewall -- **default_audiovm**: sys-audio +- **default_audiovm**: disp-sys-audio To be implemented: - **default_guivm**: sys-gui diff --git a/salt/sys-audio/README.md b/salt/sys-audio/README.md index 3a490e6..b8c25be 100644 --- a/salt/sys-audio/README.md +++ b/salt/sys-audio/README.md @@ -8,15 +8,15 @@ Audio operations in Qubes OS. * [Installation](#installation) * [Usage](#usage) * [Audio control](#audio-control) - * [Client started before sys-audio](#client-started-before-sys-audio) + * [Client started before it's AudioVM](#client-started-before-its-audiovm) * [Client turned off with a device attached](#client-turned-off-with-a-device-attached) ## Description -Creates the "sys-audio" qube for providing audio operations such as microphone -and speakers to and from qubes. By default, you can use wired USB audio, but -if you want, you can install the necessary packages for bluetooth with the -provided state. +Creates the named disposable "disp-sys-audio" qube for providing audio +operations such as microphone and speakers to and from qubes. By default, you +can use wired USB audio, but if you want, you can install the necessary +packages for bluetooth with the provided state. ## Installation @@ -45,7 +45,7 @@ qubesctl --skip-dom0 --targets=tpl-sys-audio state.apply sys-audio.install-bluet ### Audio control -The qube `sys-audio` will be used for audio capabilities for speakers and +The qube `disp-sys-audio` will be used for audio capabilities for speakers and microphone, with builtin modules, Jack port or Bluetooth. You are be able to control the volume via the volume icon that appears on the system tray. @@ -57,10 +57,10 @@ The basics are very simple to use: For more advanced features, right click the icon and click on `Open Mixer` or `Prefences`. For greater control, use the command `amixer`. -### Client started before sys-audio +### Client started before it's AudioVM -Audio will not automatically connect if sys-audio starts after the client. To -connect the client to audio server, restart the client's pipewire service: +Audio will not automatically connect if the AudioVM starts after the client. +To connect the client to audio server, restart the client's Pipewire service: ```sh systemctl --user restart pipewire ``` @@ -71,6 +71,6 @@ If you shutdown a client qube with a device attached, such as a microphone or speaker, normal operation to attach the device to the same or any other qube will fail. To be able to use the device again: -- Restart the audio server `sys-audio`; +- Restart the audio server `disp-sys-audio`; - Restart the audio client; and - Attach the device to the audio client; diff --git a/salt/sys-audio/configure-dvm.sls b/salt/sys-audio/configure-dvm.sls index 64e6133..a22be48 100644 --- a/salt/sys-audio/configure-dvm.sls +++ b/salt/sys-audio/configure-dvm.sls @@ -1,5 +1,5 @@ {# -SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. SPDX-License-Identifier: AGPL-3.0-or-later #} diff --git a/salt/sys-audio/configure-dvm.top b/salt/sys-audio/configure-dvm.top index 0804a83..35b2359 100644 --- a/salt/sys-audio/configure-dvm.top +++ b/salt/sys-audio/configure-dvm.top @@ -1,10 +1,9 @@ {# -SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. SPDX-License-Identifier: AGPL-3.0-or-later #} base: - '*': - - match: nodegroup + 'dvm-sys-audio': - sys-audio.configure-dvm diff --git a/salt/sys-audio/create.sls b/salt/sys-audio/create.sls index b8eb771..0081e54 100644 --- a/salt/sys-audio/create.sls +++ b/salt/sys-audio/create.sls @@ -1,5 +1,5 @@ {# -SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. SPDX-License-Identifier: AGPL-3.0-or-later #} @@ -40,7 +40,7 @@ features: {% set audio_pcidevs = salt['grains.get']('pci_audio_devs', []) -%} {% load_yaml as defaults -%} -name: {{ slsdotpath }} +name: disp-{{ slsdotpath }} force: True require: - qvm: dvm-{{ slsdotpath }} @@ -65,14 +65,17 @@ features: - service.cups-browsed - service.meminfo-writer - service.qubes-updates-proxy +tags: +- add: + - audiovm {%- endload %} {{ load(defaults) }} -"{{ slsdotpath }}-default_audiovm": +"disp-{{ slsdotpath }}-default_audiovm": cmd.run: - require: - - qvm: {{ slsdotpath }} - - name: qubes-prefs default_audiovm {{ slsdotpath }} + - qvm: disp-{{ slsdotpath }} + - name: qubes-prefs default_audiovm disp-{{ slsdotpath }} {% from 'utils/macros/policy.sls' import policy_set with context -%} {{ policy_set(sls_path, '80') }} diff --git a/salt/sys-audio/files/admin/policy/default.policy b/salt/sys-audio/files/admin/policy/default.policy index ea6db34..6db5624 100644 --- a/salt/sys-audio/files/admin/policy/default.policy +++ b/salt/sys-audio/files/admin/policy/default.policy @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. # SPDX-FileCopyrightText: 2023 Yukikoo neowutran +# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. # # SPDX-License-Identifier: AGPL-3.0-or-later # @@ -8,29 +8,29 @@ ## Do not modify this file, create a new policy with with a lower number in the ## file name instead. For example `30-user.policy`. -admin.vm.device.mic.Available * sys-audio @adminvm allow target=dom0 +admin.vm.device.mic.Available * disp-{{ sls_path }} @adminvm allow target=dom0 -admin.Events * sys-audio sys-audio allow target=dom0 -admin.Events * sys-audio @adminvm allow target=dom0 -admin.Events * sys-audio @tag:audiovm-sys-audio allow target=dom0 +admin.Events * disp-{{ sls_path }} disp-{{ sls_path }} allow target=dom0 +admin.Events * disp-{{ sls_path }} @adminvm allow target=dom0 +admin.Events * disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 -admin.vm.CurrentState * sys-audio sys-audio allow target=dom0 -admin.vm.CurrentState * sys-audio @adminvm allow target=dom0 -admin.vm.CurrentState * sys-audio @tag:audiovm-sys-audio allow target=dom0 +admin.vm.CurrentState * disp-{{ sls_path }} disp-{{ sls_path }} allow target=dom0 +admin.vm.CurrentState * disp-{{ sls_path }} @adminvm allow target=dom0 +admin.vm.CurrentState * disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 -admin.vm.List * sys-audio sys-audio allow target=dom0 -admin.vm.List * sys-audio @adminvm allow target=dom0 -admin.vm.List * sys-audio @tag:audiovm-sys-audio allow target=dom0 +admin.vm.List * disp-{{ sls_path }} disp-{{ sls_path }} allow target=dom0 +admin.vm.List * disp-{{ sls_path }} @adminvm allow target=dom0 +admin.vm.List * disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 -admin.vm.property.Get +audiovm sys-audio @tag:audiovm-sys-audio allow target=dom0 -admin.vm.property.Get +xid sys-audio @tag:audiovm-sys-audio allow target=dom0 -admin.vm.property.Get +stubdom_xid sys-audio @tag:audiovm-sys-audio allow target=dom0 +admin.vm.property.Get +audiovm disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 +admin.vm.property.Get +xid disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 +admin.vm.property.Get +stubdom_xid disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 -admin.vm.feature.CheckWithTemplate +audio sys-audio @tag:audiovm-sys-audio allow target=dom0 -admin.vm.feature.CheckWithTemplate +audio-model sys-audio @tag:audiovm-sys-audio allow target=dom0 -admin.vm.feature.CheckWithTemplate +supported-service.pipewire sys-audio @tag:audiovm-sys-audio allow target=dom0 -admin.vm.feature.CheckWithTemplate +audio-low-latency sys-audio @tag:audiovm-sys-audio allow target=dom0 +admin.vm.feature.CheckWithTemplate +audio disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 +admin.vm.feature.CheckWithTemplate +audio-model disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 +admin.vm.feature.CheckWithTemplate +supported-service.pipewire disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 +admin.vm.feature.CheckWithTemplate +audio-low-latency disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 -admin.vm.property.GetAll * sys-audio sys-audio allow target=dom0 -admin.vm.property.GetAll * sys-audio @tag:audiovm-sys-audio allow target=dom0 +admin.vm.property.GetAll * disp-{{ sls_path }} disp-{{ sls_path }} allow target=dom0 +admin.vm.property.GetAll * disp-{{ sls_path }} @tag:audiovm-disp-{{ sls_path }} allow target=dom0 ## vim:ft=qrexecpolicy diff --git a/salt/sys-audio/install.top b/salt/sys-audio/install.top index 11cd9dc..183c73a 100644 --- a/salt/sys-audio/install.top +++ b/salt/sys-audio/install.top @@ -1,10 +1,9 @@ {# -SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. SPDX-License-Identifier: AGPL-3.0-or-later #} base: 'tpl-sys-audio': - - match: list - sys-audio.install