From b22a4952e5d8de2e2e93c7edd65b916981abd14c Mon Sep 17 00:00:00 2001 From: John Ogle Date: Sat, 6 Sep 2025 19:01:59 -0700 Subject: [PATCH] [audio] Add easyeffects Audio EQ package --- home/home.nix | 3 ++ packages/default.nix | 1 + packages/tea-rbw/default.nix | 55 ++++++++++++++++++++++++++++++++++++ roles/audio/default.nix | 1 + 4 files changed, 60 insertions(+) create mode 100644 packages/tea-rbw/default.nix diff --git a/home/home.nix b/home/home.nix index caff3bd..52a2d36 100644 --- a/home/home.nix +++ b/home/home.nix @@ -72,6 +72,9 @@ in ## Kubernetes cluster management handled by kubectl-secure module globalInputs.google-cookie-retrieval.packages.${system}.default + + # Custom packages + customPkgs.tea-rbw ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage diff --git a/packages/default.nix b/packages/default.nix index 407b1fb..26a79dc 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,4 +1,5 @@ { pkgs, ... }: { vulkanHDRLayer = pkgs.callPackage ./vulkan-hdr-layer {}; + tea-rbw = pkgs.callPackage ./tea-rbw {}; } diff --git a/packages/tea-rbw/default.nix b/packages/tea-rbw/default.nix new file mode 100644 index 0000000..af1cb61 --- /dev/null +++ b/packages/tea-rbw/default.nix @@ -0,0 +1,55 @@ +{ pkgs, ... }: + +pkgs.writeShellScriptBin "tea" '' + set -euo pipefail + + # Check if tea config directory exists and has authentication + TEA_CONFIG_DIR="$HOME/.tea" + TEA_CONFIG_FILE="$TEA_CONFIG_DIR/config.yml" + + # Function to setup tea authentication with rbw + setup_tea_auth() { + echo "Tea authentication not found. Setting up with rbw..." + + # Check if rbw is available + if ! command -v rbw &> /dev/null; then + echo "Error: rbw is not available. Please ensure rbw is installed and configured." + exit 1 + fi + + # Try to get the token from rbw + echo "Attempting to retrieve Gitea token from rbw..." + echo "Please enter the rbw entry name for your Gitea token:" + read -r rbw_entry + + if ! token=$(rbw get "$rbw_entry" 2>/dev/null); then + echo "Error: Failed to retrieve token from rbw entry '$rbw_entry'" + echo "Available rbw entries:" + rbw list 2>/dev/null || echo "Failed to list rbw entries" + exit 1 + fi + + # Prompt for Gitea URL + echo "Please enter your Gitea URL (e.g., https://git.example.com):" + read -r gitea_url + + # Create tea config directory if it doesn't exist + mkdir -p "$TEA_CONFIG_DIR" + + # Setup tea login + if ! ${pkgs.tea}/bin/tea login add --name "default" --url "$gitea_url" --token "$token" --insecure-skip-verify=false; then + echo "Error: Failed to setup tea authentication" + exit 1 + fi + + echo "Tea authentication setup complete!" + } + + # Check if tea is already configured + if [[ ! -f "$TEA_CONFIG_FILE" ]] || ! ${pkgs.tea}/bin/tea whoami &>/dev/null; then + setup_tea_auth + fi + + # Execute tea with all provided arguments + exec ${pkgs.tea}/bin/tea "$@" +'' \ No newline at end of file diff --git a/roles/audio/default.nix b/roles/audio/default.nix index 68020c7..ba7552c 100644 --- a/roles/audio/default.nix +++ b/roles/audio/default.nix @@ -13,6 +13,7 @@ in config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ + easyeffects paprefs pavucontrol pulsemixer