Merge pull request #150548 from K900/wireplumber
wireplumber: init, add NixOS module
This commit is contained in:
commit
283c47bc45
|
@ -6055,6 +6055,13 @@
|
||||||
github = "k4leg";
|
github = "k4leg";
|
||||||
githubId = 39882583;
|
githubId = 39882583;
|
||||||
};
|
};
|
||||||
|
k900 = {
|
||||||
|
name = "Ilya K.";
|
||||||
|
email = "me@0upti.me";
|
||||||
|
github = "K900";
|
||||||
|
githubId = 386765;
|
||||||
|
matrix = "@k900:0upti.me";
|
||||||
|
};
|
||||||
kaction = {
|
kaction = {
|
||||||
name = "Dmitry Bogatov";
|
name = "Dmitry Bogatov";
|
||||||
email = "KAction@disroot.org";
|
email = "KAction@disroot.org";
|
||||||
|
|
|
@ -364,6 +364,7 @@
|
||||||
./services/desktops/malcontent.nix
|
./services/desktops/malcontent.nix
|
||||||
./services/desktops/pipewire/pipewire.nix
|
./services/desktops/pipewire/pipewire.nix
|
||||||
./services/desktops/pipewire/pipewire-media-session.nix
|
./services/desktops/pipewire/pipewire-media-session.nix
|
||||||
|
./services/desktops/pipewire/wireplumber.nix
|
||||||
./services/desktops/gnome/at-spi2-core.nix
|
./services/desktops/gnome/at-spi2-core.nix
|
||||||
./services/desktops/gnome/chrome-gnome-shell.nix
|
./services/desktops/gnome/chrome-gnome-shell.nix
|
||||||
./services/desktops/gnome/evolution-data-server.nix
|
./services/desktops/gnome/evolution-data-server.nix
|
||||||
|
|
41
nixos/modules/services/desktops/pipewire/wireplumber.nix
Normal file
41
nixos/modules/services/desktops/pipewire/wireplumber.nix
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.pipewire.wireplumber;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
meta.maintainers = [ lib.maintainers.k900 ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
services.pipewire.wireplumber = {
|
||||||
|
enable = lib.mkEnableOption "A modular session / policy manager for PipeWire";
|
||||||
|
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.wireplumber;
|
||||||
|
defaultText = lib.literalExpression "pkgs.wireplumber";
|
||||||
|
description = ''
|
||||||
|
The wireplumber derivation to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = !config.services.pipewire.media-session.enable;
|
||||||
|
message = "WirePlumber and pipewire-media-session can't be enabled at the same time.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
systemd.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
systemd.services.wireplumber.enable = config.services.pipewire.systemWide;
|
||||||
|
systemd.user.services.wireplumber.enable = !config.services.pipewire.systemWide;
|
||||||
|
|
||||||
|
systemd.services.wireplumber.wantedBy = [ "pipewire.service" ];
|
||||||
|
systemd.user.services.wireplumber.wantedBy = [ "pipewire.service" ];
|
||||||
|
};
|
||||||
|
}
|
82
pkgs/development/libraries/pipewire/wireplumber.nix
Normal file
82
pkgs/development/libraries/pipewire/wireplumber.nix
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchFromGitLab
|
||||||
|
, nix-update-script
|
||||||
|
, # base build deps
|
||||||
|
meson
|
||||||
|
, pkg-config
|
||||||
|
, ninja
|
||||||
|
, # docs build deps
|
||||||
|
python3
|
||||||
|
, doxygen
|
||||||
|
, graphviz
|
||||||
|
, # GI build deps
|
||||||
|
gobject-introspection
|
||||||
|
, # runtime deps
|
||||||
|
glib
|
||||||
|
, systemd
|
||||||
|
, lua5_4
|
||||||
|
, pipewire
|
||||||
|
, # options
|
||||||
|
enableDocs ? true
|
||||||
|
, enableGI ? stdenv.hostPlatform == stdenv.buildPlatform
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
mesonEnableFeature = b: if b then "enabled" else "disabled";
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "wireplumber";
|
||||||
|
version = "0.4.6";
|
||||||
|
|
||||||
|
outputs = [ "out" "dev" ] ++ lib.optional enableDocs "doc";
|
||||||
|
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
domain = "gitlab.freedesktop.org";
|
||||||
|
owner = "pipewire";
|
||||||
|
repo = "wireplumber";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "sha256-y+Gj9EZn67W3U81zXgp+6JAFxZSZTwwT0TB3Kueb/Tw=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
meson
|
||||||
|
pkg-config
|
||||||
|
ninja
|
||||||
|
] ++ lib.optionals enableDocs [
|
||||||
|
graphviz
|
||||||
|
] ++ lib.optionals enableGI [
|
||||||
|
gobject-introspection
|
||||||
|
] ++ lib.optionals (enableDocs || enableGI) [
|
||||||
|
doxygen
|
||||||
|
(python3.withPackages (ps: with ps;
|
||||||
|
lib.optionals enableDocs [ sphinx sphinx_rtd_theme breathe ] ++
|
||||||
|
lib.optionals enableGI [ lxml ]
|
||||||
|
))
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
glib
|
||||||
|
systemd
|
||||||
|
lua5_4
|
||||||
|
pipewire
|
||||||
|
];
|
||||||
|
|
||||||
|
mesonFlags = [
|
||||||
|
"-Dsystem-lua=true"
|
||||||
|
"-Delogind=disabled"
|
||||||
|
"-Ddoc=${mesonEnableFeature enableDocs}"
|
||||||
|
"-Dintrospection=${mesonEnableFeature enableGI}"
|
||||||
|
];
|
||||||
|
|
||||||
|
passthru.updateScript = nix-update-script {
|
||||||
|
attrPath = pname;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A modular session / policy manager for PipeWire";
|
||||||
|
homepage = "https://pipewire.org";
|
||||||
|
license = licenses.mit;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
maintainers = with maintainers; [ k900 ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -13761,6 +13761,7 @@ with pkgs;
|
||||||
pipewire = callPackage ../development/libraries/pipewire {};
|
pipewire = callPackage ../development/libraries/pipewire {};
|
||||||
pipewire-media-session = callPackage ../development/libraries/pipewire/media-session.nix {};
|
pipewire-media-session = callPackage ../development/libraries/pipewire/media-session.nix {};
|
||||||
pipewire_0_2 = callPackage ../development/libraries/pipewire/0.2.nix {};
|
pipewire_0_2 = callPackage ../development/libraries/pipewire/0.2.nix {};
|
||||||
|
wireplumber = callPackage ../development/libraries/pipewire/wireplumber.nix {};
|
||||||
|
|
||||||
pyradio = callPackage ../applications/audio/pyradio {};
|
pyradio = callPackage ../applications/audio/pyradio {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue