feat: fix idle inhibit using audio workaround

This commit is contained in:
teutat3s 2024-04-07 22:07:42 +02:00
parent 15ab5192b7
commit 31906a965e
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
4 changed files with 87 additions and 1 deletions

View file

@ -281,6 +281,22 @@
"type": "github" "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": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
@ -296,7 +312,8 @@
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"triton-vmtools": "triton-vmtools", "triton-vmtools": "triton-vmtools",
"tritonshell": "tritonshell", "tritonshell": "tritonshell",
"unstable": "unstable" "unstable": "unstable",
"wayland-pipewire-idle-inhibit": "wayland-pipewire-idle-inhibit"
} }
}, },
"systems": { "systems": {
@ -344,6 +361,24 @@
"type": "github" "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": { "triton-vmtools": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
@ -424,6 +459,30 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "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", "root": "root",

View file

@ -41,6 +41,10 @@
tritonshell.url = "git+https://git.pub.solar/teutat3s/tritonshell?ref=main"; tritonshell.url = "git+https://git.pub.solar/teutat3s/tritonshell?ref=main";
tritonshell.inputs.nixpkgs.follows = "unstable"; 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, ...}: outputs = inputs@{ self, ...}:

View file

@ -2,6 +2,7 @@
lib, lib,
config, config,
pkgs, pkgs,
flake,
... ...
}: }:
with lib; let with lib; let
@ -77,6 +78,27 @@ in {
]; ];
home-manager.users."${psCfg.user.name}" = { 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.enable = true;
#programs.waybar.systemd.enable = true; #programs.waybar.systemd.enable = true;

View file

@ -28,6 +28,7 @@
nix-direnv = unstable.nix-direnv; nix-direnv = unstable.nix-direnv;
_1password = unstable._1password; _1password = unstable._1password;
_1password-cli = unstable._1password-cli; _1password-cli = unstable._1password-cli;
wayland-pipewire-idle-inhibit = unstable.wayland-pipewire-idle-inhibit;
wlvncc = unstable.wlvncc; wlvncc = unstable.wlvncc;
#vimPlugins = prev.vimPlugins // {inherit (unstable.vimPlugins) nvim-lspconfig;}; #vimPlugins = prev.vimPlugins // {inherit (unstable.vimPlugins) nvim-lspconfig;};
}) })