From 1c19fbdd88b075c31bea3ca26d408da1ef3e637c Mon Sep 17 00:00:00 2001 From: Simon Parri Date: Wed, 4 Jun 2025 12:20:54 -0500 Subject: hosts/tomato: Add new bluetooth module and use it --- hosts/ades/hardware.nix | 2 +- hosts/tomato/hardware.nix | 1 + modules/bluetooth.nix | 16 ++++++++++++++++ modules/default.nix | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 modules/bluetooth.nix diff --git a/hosts/ades/hardware.nix b/hosts/ades/hardware.nix index c04ac86..ac7fde8 100644 --- a/hosts/ades/hardware.nix +++ b/hosts/ades/hardware.nix @@ -16,7 +16,7 @@ linux-firmware ]; - hardware.bluetooth.enable = true; + this.bluetooth.enable = true; nixpkgs.hostPlatform = "x86_64-linux"; } diff --git a/hosts/tomato/hardware.nix b/hosts/tomato/hardware.nix index 2be8d07..8e3a0d1 100644 --- a/hosts/tomato/hardware.nix +++ b/hosts/tomato/hardware.nix @@ -33,6 +33,7 @@ in hardware.graphics.extraPackages = [pkgs.intel-vaapi-driver]; services.xserver.videoDrivers = ["intel"]; + this.bluetooth.enable = true; hardware.firmware = with pkgs; [ linux-firmware diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix new file mode 100644 index 0000000..cf7cee5 --- /dev/null +++ b/modules/bluetooth.nix @@ -0,0 +1,16 @@ +{ lib, pkgs, config, ... }: + +let cfg = config.this.bluetooth; +in +{ + options.this.bluetooth = { + enable = lib.mkEnableOption "bluetooth"; + }; + + config = lib.mkIf cfg.enable { + hardware.bluetooth.enable = true; + environment.systemPackages = with pkgs; [ + bluetuith + ]; + }; +} diff --git a/modules/default.nix b/modules/default.nix index fe4bac6..034a4e3 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -11,6 +11,7 @@ ./sets.nix ./syslog.nix ./hosts.nix + ./bluetooth.nix ./overlays ]; -- cgit v1.2.3