Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ sudo pacman -S base-devel cmake hidapi

# fedora
sudo dnf install gcc cmake hidapi-devel

# nix
inputs = {
btd700ctl = {
url = "github:sobalap/btd700ctl";
inputs.nixpkgs.follows = "nixpkgs";
};
}

modules = [
inputs.btd700ctl.nixosModules.default
]

Comment on lines +42 to +53

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new Nix configuration snippet is inside a ```bash code block and is not valid Nix as written (missing trailing semicolons like inputs = { ... }; / `modules = [ ... ];`). Move it to a dedicated `nix` (or untyped) fenced block and make the snippet syntactically correct so users can copy/paste it.

Copilot uses AI. Check for mistakes.
```

### build
Expand Down
70 changes: 70 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
description = "Unofficial linux driver for the Sennheiser BTD 700 dongle";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "riscv64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.stdenv.mkDerivation {
pname = "btd700ctl";
version = "unstable-${self.shortRev or "dirty"}";

src = ./.;

nativeBuildInputs = with pkgs; [ cmake pkg-config makeWrapper ];
buildInputs = with pkgs; [ hidapi ];

postInstall = ''
install -Dm644 ../udev/99-btd700.rules $out/lib/udev/rules.d/99-btd700.rules
substituteInPlace $out/lib/systemd/user/btd700d.service \
--replace-fail "/usr/local/bin/btd700d" "$out/bin/btd700d"
wrapProgram $out/bin/btd700d \
--prefix PATH : ${pkgs.wireplumber}/bin
'';

meta = with pkgs.lib; {
description = "Unofficial linux driver for the Sennheiser BTD 700 dongle";
homepage = "https://github.com/sobalap/btd700ctl";
license = licenses.lgpl21Only;
platforms = platforms.linux;
mainProgram = "btd700d";
};
};
});
nixosModules.default = { pkgs, lib, config, ... }:
let
pkg = self.packages.${pkgs.system}.default;
in {
assertions = [
{
assertion = config.services.pipewire.enable == true;
message = "The btd700d module requires 'services.pipewire.enable = true;'";
}
{
assertion = config.services.pipewire.wireplumber.enable == true;
message = "The btd700d module requires 'services.pipewire.wireplumber.enable = true;'";
}
];

services.udev.packages = [ pkg ];
environment.systemPackages = [ pkg ];
systemd.packages = [ pkg ];

systemd.user.services.btd700d = {
wantedBy = [ "default.target" ];
enable = true;
};
Comment on lines +64 to +67

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemd.user.services.btd700d is enabled without defining serviceConfig.ExecStart/script (or another mechanism) to actually start the daemon. Unless NixOS is meant to enable a unit file provided by systemd.user.packages, this will produce an incomplete unit and fail to start. Either define the unit contents here (ExecStart pointing at ${pkg}/bin/btd700d) or install the packaged user unit via the appropriate systemd.user.packages/unit-enabling pattern.

Copilot uses AI. Check for mistakes.
};
};
}