34 lines
613 B
Nix
34 lines
613 B
Nix
{
|
|
config,
|
|
lib,
|
|
namespace,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.mjallen.programs.waybar;
|
|
|
|
pythonEnv = pkgs.python3.withPackages (_ps: [
|
|
pkgs.${namespace}.pipewire-python
|
|
]);
|
|
|
|
waybar-audio = pkgs.writeScriptBin "waybar-audio" ''
|
|
#!${pythonEnv}/bin/python
|
|
"""run with the special python"""
|
|
|
|
from pipewire_python.controller import Controller
|
|
|
|
audio_controller = Controller()
|
|
|
|
print(audio_controller.get_config())
|
|
print(audio_controller.get_list_targets())
|
|
'';
|
|
in
|
|
{
|
|
imports = [ ../options.nix ];
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
home.packages = [ waybar-audio ];
|
|
};
|
|
}
|