1# pipewire service.
2{ config, lib, pkgs, ... }:
3
4with lib;
5
6let
7 cfg = config.services.pipewire;
8 packages = with pkgs; [ pipewire ];
9
10in {
11 ###### interface
12 options = {
13 services.pipewire = {
14 enable = mkEnableOption "pipewire service";
15
16 socketActivation = mkOption {
17 default = true;
18 type = types.bool;
19 description = ''
20 Automatically run pipewire when connections are made to the pipewire socket.
21 '';
22 };
23 };
24 };
25
26
27 ###### implementation
28 config = mkIf cfg.enable {
29 environment.systemPackages = packages;
30
31 systemd.packages = packages;
32
33 systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ];
34 };
35
36 meta.maintainers = with lib.maintainers; [ jtojnar ];
37}