diff options
author | Peter Hoeg <peter@hoeg.com> | 2018-07-06 12:00:10 +0800 |
---|---|---|
committer | Peter Hoeg <peter@hoeg.com> | 2018-07-06 12:03:24 +0800 |
commit | 139a6b41067b743f7d3f516c2a82eec948a06ebd (patch) | |
tree | 4db86f4074de9b5655bae6f32da167ca67c04b49 /nixos | |
parent | be1461fc0ab29c45c69e7b2c2097c887750e4fe0 (diff) |
pipewire (nixos): add support for socket activation
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/desktops/pipewire.nix | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/nixos/modules/services/desktops/pipewire.nix b/nixos/modules/services/desktops/pipewire.nix index 263a06156f84b..13f3d61e84ca1 100644 --- a/nixos/modules/services/desktops/pipewire.nix +++ b/nixos/modules/services/desktops/pipewire.nix @@ -3,20 +3,34 @@ with lib; -{ +let + cfg = config.services.pipewire; + packages = with pkgs; [ pipewire ]; + +in { ###### 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 config.services.pipewire.enable { - environment.systemPackages = [ pkgs.pipewire ]; + config = mkIf cfg.enable { + environment.systemPackages = packages; + + systemd.packages = packages; - systemd.packages = [ pkgs.pipewire ]; + systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ]; }; meta.maintainers = with lib.maintainers; [ jtojnar ]; |