diff options
author | Peter Hoeg <peter@hoeg.com> | 2018-07-06 15:26:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 15:26:39 +0800 |
commit | f2d9f3ab85e1481a703a2aca1ec869466c196c92 (patch) | |
tree | 1dcc03868c2d47d9d0799e355997f18818c48892 /nixos/modules/services | |
parent | 93f276d47dc6c074b8befc228e00eeb1ddf471ba (diff) | |
parent | 139a6b41067b743f7d3f516c2a82eec948a06ebd (diff) | |
download | nixlib-f2d9f3ab85e1481a703a2aca1ec869466c196c92.tar nixlib-f2d9f3ab85e1481a703a2aca1ec869466c196c92.tar.gz nixlib-f2d9f3ab85e1481a703a2aca1ec869466c196c92.tar.bz2 nixlib-f2d9f3ab85e1481a703a2aca1ec869466c196c92.tar.lz nixlib-f2d9f3ab85e1481a703a2aca1ec869466c196c92.tar.xz nixlib-f2d9f3ab85e1481a703a2aca1ec869466c196c92.tar.zst nixlib-f2d9f3ab85e1481a703a2aca1ec869466c196c92.zip |
Merge pull request #43097 from peterhoeg/m/pipewire
pipewire (nixos): add socket activation support
Diffstat (limited to 'nixos/modules/services')
-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 263a06156f84..13f3d61e84ca 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 ]; |