diff --git a/flake.lock b/flake.lock index 43ec4f21..79780c28 100644 --- a/flake.lock +++ b/flake.lock @@ -281,6 +281,22 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1695644571, + "narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", @@ -296,7 +312,8 @@ "nixpkgs": "nixpkgs", "triton-vmtools": "triton-vmtools", "tritonshell": "tritonshell", - "unstable": "unstable" + "unstable": "unstable", + "wayland-pipewire-idle-inhibit": "wayland-pipewire-idle-inhibit" } }, "systems": { @@ -344,6 +361,24 @@ "type": "github" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1704649711, + "narHash": "sha256-+qxqJrZwvZGilGiLQj3QbYssPdYCwl7ejwMImgH7VBQ=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "04f25d7bec9fb29d2c3bacaa48a3304840000d36", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "triton-vmtools": { "inputs": { "flake-utils": "flake-utils", @@ -424,6 +459,30 @@ "repo": "flake-utils", "type": "github" } + }, + "wayland-pipewire-idle-inhibit": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1712274476, + "narHash": "sha256-REwWVCN4VQB1XrxSk2nsggIw82OILzsU4Mq5FYXIIOU=", + "owner": "rafaelrc7", + "repo": "wayland-pipewire-idle-inhibit", + "rev": "5b8c23f28c1e4c2fde8477a1783d997d83f38f1d", + "type": "github" + }, + "original": { + "owner": "rafaelrc7", + "repo": "wayland-pipewire-idle-inhibit", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 42350348..896edb35 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,10 @@ tritonshell.url = "git+https://git.pub.solar/teutat3s/tritonshell?ref=main"; tritonshell.inputs.nixpkgs.follows = "unstable"; + + wayland-pipewire-idle-inhibit.url = "github:rafaelrc7/wayland-pipewire-idle-inhibit"; + wayland-pipewire-idle-inhibit.inputs.nixpkgs.follows = "nixpkgs"; + wayland-pipewire-idle-inhibit.inputs.flake-parts.follows = "flake-parts"; }; outputs = inputs@{ self, ...}: diff --git a/modules/graphical/sway/default.nix b/modules/graphical/sway/default.nix index 063e85e0..e6c8c573 100644 --- a/modules/graphical/sway/default.nix +++ b/modules/graphical/sway/default.nix @@ -2,6 +2,7 @@ lib, config, pkgs, + flake, ... }: with lib; let @@ -77,6 +78,27 @@ in { ]; home-manager.users."${psCfg.user.name}" = { + imports = [ + flake.self.inputs.wayland-pipewire-idle-inhibit.homeModules.default + ]; + + services.wayland-pipewire-idle-inhibit = { + enable = true; + package = pkgs.wayland-pipewire-idle-inhibit; + systemdTarget = "sway-session.target"; + settings = { + verbosity = "INFO"; + media_minimum_duration = 10; + idle_inhibitor = "wayland"; + sink_whitelist = [ + { name = "Starship/Matisse HD Audio Controller Analog Stereo"; } + ]; + node_blacklist = [ + { name = "spotify"; } + { app_name = "Music Player Daemon"; } + ]; + }; + }; programs.waybar.enable = true; #programs.waybar.systemd.enable = true; diff --git a/overlays/default.nix b/overlays/default.nix index 82a5ff58..d6616a31 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -28,6 +28,7 @@ nix-direnv = unstable.nix-direnv; _1password = unstable._1password; _1password-cli = unstable._1password-cli; + wayland-pipewire-idle-inhibit = unstable.wayland-pipewire-idle-inhibit; wlvncc = unstable.wlvncc; #vimPlugins = prev.vimPlugins // {inherit (unstable.vimPlugins) nvim-lspconfig;}; })