aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/desktops/pipewire.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/desktops/pipewire.nix')
-rw-r--r--nixpkgs/nixos/modules/services/desktops/pipewire.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/services/desktops/pipewire.nix b/nixpkgs/nixos/modules/services/desktops/pipewire.nix
new file mode 100644
index 00000000000..13f3d61e84c
--- /dev/null
+++ b/nixpkgs/nixos/modules/services/desktops/pipewire.nix
@@ -0,0 +1,37 @@
+# pipewire service.
+{ config, lib, pkgs, ... }:
+
+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 cfg.enable {
+ environment.systemPackages = packages;
+
+ systemd.packages = packages;
+
+ systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ];
+ };
+
+ meta.maintainers = with lib.maintainers; [ jtojnar ];
+}