2018-01-30 17:58:56 +00:00
|
|
|
# pipewire service.
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2018-07-06 05:00:10 +01:00
|
|
|
let
|
|
|
|
cfg = config.services.pipewire;
|
|
|
|
packages = with pkgs; [ pipewire ];
|
|
|
|
|
|
|
|
in {
|
2018-01-30 17:58:56 +00:00
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.pipewire = {
|
|
|
|
enable = mkEnableOption "pipewire service";
|
2018-07-06 05:00:10 +01:00
|
|
|
|
|
|
|
socketActivation = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
|
|
|
Automatically run pipewire when connections are made to the pipewire socket.
|
|
|
|
'';
|
|
|
|
};
|
2018-01-30 17:58:56 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
2018-07-06 05:00:10 +01:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = packages;
|
|
|
|
|
|
|
|
systemd.packages = packages;
|
2018-01-30 17:58:56 +00:00
|
|
|
|
2018-07-06 05:00:10 +01:00
|
|
|
systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ];
|
2018-01-30 17:58:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta.maintainers = with lib.maintainers; [ jtojnar ];
|
|
|
|
}
|