pipewire: Add update script

This commit is contained in:
talyz 2021-04-27 12:52:41 +02:00
parent 6edd102013
commit fb86d324d1
No known key found for this signature in database
GPG key ID: 2DED2151F4671A2B
3 changed files with 49 additions and 29 deletions

View file

@ -1,6 +0,0 @@
# Updating
1. Update the version & hash in pkgs/development/libraries/pipewire/default.nix
2. run `nix build -f /path/to/nixpkgs/checkout pipewire pipewire.mediaSession`
3. copy all JSON files from result/etc/pipewire and result-mediaSession/etc/pipewire/media-session.d to this directory
4. add new files to the module config and passthru tests

View file

@ -60,7 +60,7 @@ let
owner = "pipewire";
repo = "pipewire";
rev = version;
hash = "sha256:1rqi1sa937lp89ai79b5n7m0p66pigpj4w1mr2vq4dycfp8vppxk";
sha256 = "sha256-s9+70XXMN4K3yDVwIu+L15gL6rFlpRNVQpeekZQOEec=";
};
patches = [
@ -146,29 +146,31 @@ let
moveToOutput "bin/pipewire-pulse" "$pulse"
'';
passthru.tests = {
installedTests = nixosTests.installed-tests.pipewire;
passthru = {
updateScript = ./update.sh;
tests = {
installedTests = nixosTests.installed-tests.pipewire;
# This ensures that all the paths used by the NixOS module are found.
test-paths = callPackage ./test-paths.nix {
paths-out = [
"share/alsa/alsa.conf.d/50-pipewire.conf"
"nix-support/etc/pipewire/client.conf.json"
"nix-support/etc/pipewire/client-rt.conf.json"
"nix-support/etc/pipewire/jack.conf.json"
"nix-support/etc/pipewire/pipewire.conf.json"
"nix-support/etc/pipewire/pipewire-pulse.conf.json"
];
paths-out-media-session = [
"nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json"
"nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json"
"nix-support/etc/pipewire/media-session.d/media-session.conf.json"
"nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json"
];
paths-lib = [
"lib/alsa-lib/libasound_module_pcm_pipewire.so"
"share/alsa-card-profile/mixer"
];
# This ensures that all the paths used by the NixOS module are found.
test-paths = callPackage ./test-paths.nix {
paths-out = [
"share/alsa/alsa.conf.d/50-pipewire.conf"
"nix-support/etc/pipewire/client.conf.json"
"nix-support/etc/pipewire/jack.conf.json"
"nix-support/etc/pipewire/pipewire.conf.json"
"nix-support/etc/pipewire/pipewire-pulse.conf.json"
];
paths-out-media-session = [
"nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json"
"nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json"
"nix-support/etc/pipewire/media-session.d/media-session.conf.json"
"nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json"
];
paths-lib = [
"lib/alsa-lib/libasound_module_pcm_pipewire.so"
"share/alsa-card-profile/mixer"
];
};
};
};

View file

@ -0,0 +1,24 @@
#!/usr/bin/env nix-shell
#!nix-shell -p nix-update -i bash
# shellcheck shell=bash
set -o errexit -o pipefail -o nounset -o errtrace
shopt -s inherit_errexit
shopt -s nullglob
IFS=$'\n'
NIXPKGS_ROOT="$(git rev-parse --show-toplevel)"
cd "$NIXPKGS_ROOT"
nix-update pipewire
outputs=$(nix-build . -A pipewire -A pipewire.mediaSession)
for p in $outputs; do
conf_files=$(find "$p/nix-support/etc/pipewire/" -name '*.conf.json')
for c in $conf_files; do
file_name=$(basename "$c")
if [[ ! -e "nixos/modules/services/desktops/pipewire/$file_name" ]]; then
echo "New file $file_name found! Add it to the module config and passthru tests!"
fi
install -m 0644 "$c" "nixos/modules/services/desktops/pipewire/"
done
done