Merge pull request #43097 from peterhoeg/m/pipewire

pipewire (nixos): add socket activation support
This commit is contained in:
Peter Hoeg 2018-07-06 15:26:39 +08:00 committed by GitHub
commit f2d9f3ab85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,20 +3,34 @@
with lib; with lib;
{ let
cfg = config.services.pipewire;
packages = with pkgs; [ pipewire ];
in {
###### interface ###### interface
options = { options = {
services.pipewire = { services.pipewire = {
enable = mkEnableOption "pipewire service"; enable = mkEnableOption "pipewire service";
socketActivation = mkOption {
default = true;
type = types.bool;
description = ''
Automatically run pipewire when connections are made to the pipewire socket.
'';
};
}; };
}; };
###### implementation ###### implementation
config = mkIf config.services.pipewire.enable { config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.pipewire ]; environment.systemPackages = packages;
systemd.packages = [ pkgs.pipewire ]; systemd.packages = packages;
systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ];
}; };
meta.maintainers = with lib.maintainers; [ jtojnar ]; meta.maintainers = with lib.maintainers; [ jtojnar ];