git.iko.soy/typeable/nixpkgs
on master help sign in
pipewire: Add update script
commitfb86d324d1a6f05a6da55af6e2ae8922e7063498 authortalyz <kim.lindberger@gmail.com> dateTue 27 Apr 2021, 12:52 (6 years ago) parent6edd102
3 files changed+50−30
nixos/modules/services/desktops/pipewire/README.md−6 pkgs/development/libraries/pipewire/default.nix+26−24 pkgs/development/libraries/pipewire/update.sh+24
nixos/modules/services/desktops/pipewire/README.mddeleted−6
@@ -1,6 +0,0 @@
1−# Updating
2−
3−1. Update the version & hash in pkgs/development/libraries/pipewire/default.nix
4−2. run `nix build -f /path/to/nixpkgs/checkout pipewire pipewire.mediaSession`
5−3. copy all JSON files from result/etc/pipewire and result-mediaSession/etc/pipewire/media-session.d to this directory
6−4. add new files to the module config and passthru tests
pkgs/development/libraries/pipewire/default.nix+26−24
@@ -60,7 +60,7 @@ let
6060 owner = "pipewire";
6161 repo = "pipewire";
6262 rev = version;
63− hash = "sha256:1rqi1sa937lp89ai79b5n7m0p66pigpj4w1mr2vq4dycfp8vppxk";
63+ sha256 = "sha256-s9+70XXMN4K3yDVwIu+L15gL6rFlpRNVQpeekZQOEec=";
6464 };
6565
6666 patches = [
@@ -146,29 +146,31 @@ let
146146 moveToOutput "bin/pipewire-pulse" "$pulse"
147147 '';
148148
149− passthru.tests = {
150− installedTests = nixosTests.installed-tests.pipewire;
151−
152− # This ensures that all the paths used by the NixOS module are found.
153− test-paths = callPackage ./test-paths.nix {
154− paths-out = [
155− "share/alsa/alsa.conf.d/50-pipewire.conf"
156− "nix-support/etc/pipewire/client.conf.json"
157− "nix-support/etc/pipewire/client-rt.conf.json"
158− "nix-support/etc/pipewire/jack.conf.json"
159− "nix-support/etc/pipewire/pipewire.conf.json"
160− "nix-support/etc/pipewire/pipewire-pulse.conf.json"
161− ];
162− paths-out-media-session = [
163− "nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json"
164− "nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json"
165− "nix-support/etc/pipewire/media-session.d/media-session.conf.json"
166− "nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json"
167− ];
168− paths-lib = [
169− "lib/alsa-lib/libasound_module_pcm_pipewire.so"
170− "share/alsa-card-profile/mixer"
171− ];
149+ passthru = {
150+ updateScript = ./update.sh;
151+ tests = {
152+ installedTests = nixosTests.installed-tests.pipewire;
153+
154+ # This ensures that all the paths used by the NixOS module are found.
155+ test-paths = callPackage ./test-paths.nix {
156+ paths-out = [
157+ "share/alsa/alsa.conf.d/50-pipewire.conf"
158+ "nix-support/etc/pipewire/client.conf.json"
159+ "nix-support/etc/pipewire/jack.conf.json"
160+ "nix-support/etc/pipewire/pipewire.conf.json"
161+ "nix-support/etc/pipewire/pipewire-pulse.conf.json"
162+ ];
163+ paths-out-media-session = [
164+ "nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json"
165+ "nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json"
166+ "nix-support/etc/pipewire/media-session.d/media-session.conf.json"
167+ "nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json"
168+ ];
169+ paths-lib = [
170+ "lib/alsa-lib/libasound_module_pcm_pipewire.so"
171+ "share/alsa-card-profile/mixer"
172+ ];
173+ };
172174 };
173175 };
174176
pkgs/development/libraries/pipewire/update.shnew file+24
@@ -0,0 +1,24 @@
1+#!/usr/bin/env nix-shell
2+#!nix-shell -p nix-update -i bash
3+# shellcheck shell=bash
4+
5+set -o errexit -o pipefail -o nounset -o errtrace
6+shopt -s inherit_errexit
7+shopt -s nullglob
8+IFS=$'\n'
9+
10+NIXPKGS_ROOT="$(git rev-parse --show-toplevel)"
11+
12+cd "$NIXPKGS_ROOT"
13+nix-update pipewire
14+outputs=$(nix-build . -A pipewire -A pipewire.mediaSession)
15+for p in $outputs; do
16+ conf_files=$(find "$p/nix-support/etc/pipewire/" -name '*.conf.json')
17+ for c in $conf_files; do
18+ file_name=$(basename "$c")
19+ if [[ ! -e "nixos/modules/services/desktops/pipewire/$file_name" ]]; then
20+ echo "New file $file_name found! Add it to the module config and passthru tests!"
21+ fi
22+ install -m 0644 "$c" "nixos/modules/services/desktops/pipewire/"
23+ done
24+done