47 lines
917 B
Nix
47 lines
917 B
Nix
![]() |
{
|
||
|
config,
|
||
|
lib,
|
||
|
pkgs,
|
||
|
...
|
||
|
}:
|
||
|
|
||
|
{
|
||
|
imports = [ ];
|
||
|
|
||
|
options.me = {
|
||
|
bluetooth.enable = lib.mkOption {
|
||
|
type = lib.types.bool;
|
||
|
default = false;
|
||
|
example = true;
|
||
|
description = "Whether we want to install bluetooth.";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf config.me.bluetooth.enable (
|
||
|
lib.mkMerge [
|
||
|
{
|
||
|
environment.systemPackages = with pkgs; [
|
||
|
];
|
||
|
|
||
|
hardware.bluetooth = {
|
||
|
enable = true;
|
||
|
powerOnBoot = true;
|
||
|
settings = {
|
||
|
General = {
|
||
|
# Enable support for showing battery charge level.
|
||
|
Experimental = true;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||
|
hideMounts = true;
|
||
|
directories = [
|
||
|
"/var/lib/bluetooth" # Bluetooth pairing information.
|
||
|
];
|
||
|
};
|
||
|
}
|
||
|
]
|
||
|
);
|
||
|
}
|