Rebase to flake parts #7

This commit is contained in:
2026-05-08 19:12:16 -03:00
parent 1015cf4577
commit f98606dcce
23 changed files with 1060 additions and 11 deletions
+50
View File
@@ -0,0 +1,50 @@
{ ... }: {
flake.nixosModules.systemBluetooth =
{ config, lib, pkgs, ... }:
let
cfg = config.chiasson.system.bluetooth;
d = config.chiasson.desktop or { };
guiEnabled =
((d.hyprland or { }).enable or false)
|| ((d.niri or { }).enable or false)
|| ((d.plasma or { }).enable or false);
in
{
options.chiasson.system.bluetooth = {
enable = lib.mkEnableOption ''
BlueZ defaults (power on boot, experimental, fast connectable). Pull via `client-services` or direct import; off on BT-less boxes.
'' // {
default = true;
};
installBluejay = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
[Bluejay](https://invent.kde.org/plasma/bluejay) on GUI hosts with BT. False `bluetoothctl` only.
'';
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Experimental = true;
FastConnectable = true;
};
Policy = {
AutoEnable = true;
};
};
};
})
(lib.mkIf (cfg.enable && cfg.installBluejay && guiEnabled) {
environment.systemPackages = [ pkgs.bluejay ];
})
];
};
}