common: profiles: migrate bluetooth

This commit is contained in:
Bruno BELANYI 2024-01-03 16:51:34 +00:00
parent 2027bb327e
commit 034cd3ac55
4 changed files with 20 additions and 17 deletions

View file

@ -0,0 +1,19 @@
{ config, lib, type, ... }:
let
cfg = config.my.profiles.bluetooth;
in
{
options.my.profiles.bluetooth = with lib; {
enable = mkEnableOption "bluetooth profile";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (type == "home") {
my.home.bluetooth.enable = true;
})
(lib.optionalAttrs (type == "nixos") {
my.hardware.bluetooth.enable = true;
})
]);
}

View file

@ -2,6 +2,6 @@
{ ... }:
{
imports = [
# FIXME: empty
./bluetooth
];
}

View file

@ -1,15 +0,0 @@
{ config, lib, ... }:
let
cfg = config.my.profiles.bluetooth;
in
{
options.my.profiles.bluetooth = with lib; {
enable = mkEnableOption "bluetooth profile";
};
config = lib.mkIf cfg.enable {
my.hardware.bluetooth.enable = true;
my.home.bluetooth.enable = true;
};
}

View file

@ -2,7 +2,6 @@
{ ... }:
{
imports = [
./bluetooth
./devices
./gtk
./laptop