diff --git a/modules/home/puregarlic/desktop/noctalia.nix b/modules/home/puregarlic/desktop/noctalia.nix index 1ec16f9..504e668 100644 --- a/modules/home/puregarlic/desktop/noctalia.nix +++ b/modules/home/puregarlic/desktop/noctalia.nix @@ -1,15 +1,49 @@ -{ inputs, pkgs, ...}: +{ config, inputs, lib, pkgs, ... }: +let + librepods = pkgs.callPackage ../../../../packages/librepods { }; +in { imports = [ inputs.noctalia.homeModules.default ]; home.packages = [ + librepods pkgs.ffmpeg pkgs.jq pkgs.xdg-utils ]; + systemd.user.services.librepods = { + Unit = { + Description = "LibrePods AirPods daemon"; + After = [ config.wayland.systemd.target ]; + PartOf = [ config.wayland.systemd.target ]; + }; + + Service = { + ExecStart = "${lib.getExe librepods} --headless"; + Environment = [ "QT_LOGGING_RULES=openpods.debug=false" ]; + Restart = "on-failure"; + RestartSec = 5; + UMask = "0077"; + StateDirectory = "librepods"; + StateDirectoryMode = "0700"; + ConfigurationDirectory = "AirPodsTrayApp"; + ConfigurationDirectoryMode = "0700"; + NoNewPrivileges = true; + PrivateTmp = true; + RestrictSUIDSGID = true; + LockPersonality = true; + }; + + Install.WantedBy = [ config.wayland.systemd.target ]; + }; + + systemd.user.services.noctalia.Service.Environment = [ + "PATH=${lib.makeBinPath [ librepods ]}:/run/current-system/sw/bin:%h/.nix-profile/bin:/etc/profiles/per-user/%u/bin" + ]; + stylix.targets.noctalia-shell.enable = false; stylix.targets.noctalia.enable = false; programs.noctalia = { @@ -42,6 +76,8 @@ "notifications" "battery" "volume" + "airpods" + "bluetooth" "brightness" "tailscale" "network" @@ -52,12 +88,14 @@ widget = { media.album_art_only = true; + airpods.type = "harveywuk/airpods:airpods"; pomodoro.type = "thepunkoff/pomodoro:widget"; tailscale.type = "davemhammer/tailscale:status"; }; plugins = { enabled = [ + "harveywuk/airpods" "thepunkoff/pomodoro" "davemhammer/tailscale" ]; diff --git a/packages/librepods/default.nix b/packages/librepods/default.nix new file mode 100644 index 0000000..babf675 --- /dev/null +++ b/packages/librepods/default.nix @@ -0,0 +1,54 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + ninja, + pkg-config, + qt6, + openssl, + libpulseaudio, +}: +stdenv.mkDerivation { + pname = "librepods-noctalia"; + version = "0.1-unstable-2026-08-26"; + + src = fetchFromGitHub { + owner = "harveywuk"; + repo = "librepods"; + rev = "4ed49df0b301ac3e6fba9c81dfbbb6726cc52201"; + hash = "sha256-Ygoqz5lnGMwZkys+Q4c4pyAUI0llvpGZ/ij5E91CkAg="; + }; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + ninja + pkg-config + qt6.qttools + qt6.wrapQtAppsHook + ]; + + buildInputs = [ + qt6.qtbase + qt6.qtconnectivity + qt6.qtdeclarative + openssl + libpulseaudio + ]; + + cmakeFlags = [ "-DBUILD_TESTING=OFF" ]; + + postInstall = '' + rm "$out/share/systemd/user/librepods.service" + ''; + + meta = { + description = "Patched LibrePods daemon and CLI for the Noctalia AirPods plugin"; + homepage = "https://github.com/harveywuk/librepods"; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.linux; + mainProgram = "librepods"; + }; +} diff --git a/profiles/desktop.nix b/profiles/desktop.nix index ab908a1..f5436e8 100644 --- a/profiles/desktop.nix +++ b/profiles/desktop.nix @@ -27,11 +27,12 @@ hardware.bluetooth.enable = true; services.tuned.enable = true; services.upower.enable = true; + services.gvfs.enable = true; nix.settings.allowed-users = [ "puregarlic" ]; users.users.puregarlic = { isNormalUser = true; - extraGroups = [ "wheel" ]; + extraGroups = [ "wheel" "networkmanager" ]; shell = pkgs.nushell; };