Rebase to flake parts #7
This commit is contained in:
@@ -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 ];
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user