mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 08:33:54 +00:00
42 lines
785 B
Nix
42 lines
785 B
Nix
# pipewire service.
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.pipewire;
|
|
packages = with pkgs; [ pipewire ];
|
|
|
|
in {
|
|
|
|
meta = {
|
|
maintainers = teams.freedesktop.members;
|
|
};
|
|
|
|
###### interface
|
|
options = {
|
|
services.pipewire = {
|
|
enable = mkEnableOption "pipewire service";
|
|
|
|
socketActivation = mkOption {
|
|
default = true;
|
|
type = types.bool;
|
|
description = ''
|
|
Automatically run pipewire when connections are made to the pipewire socket.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
###### implementation
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = packages;
|
|
|
|
systemd.packages = packages;
|
|
|
|
systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ];
|
|
};
|
|
|
|
}
|