Move bluetooth to an option

This commit is contained in:
Andreas Zweili 2023-05-27 23:58:39 +02:00
parent f2c8234a58
commit e85690e030
4 changed files with 22 additions and 14 deletions

View File

@ -1,19 +1,26 @@
{ ... }:
{ config, lib, ... }:
let
cfg = config.hardware.az_bluetooth;
in
{
# Blueooth support in general
hardware.bluetooth = {
enable = true;
powerOnBoot = false;
options = {
hardware.az_bluetooth.enable = lib.mkEnableOption "Enable Bluetooth";
};
# Blueman applet
services.blueman.enable = true;
config = lib.mkIf cfg.enable {
# Blueooth support in general
hardware.bluetooth = {
enable = true;
powerOnBoot = false;
};
systemd.user.services.blueman-applet = {
partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
# Blueman applet
services.blueman.enable = true;
systemd.user.services.blueman-applet = {
partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
};
};
}

View File

@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./bluetooth
./dvd
./nvidia
];

View File

@ -4,7 +4,6 @@
custom.inputs.nixos-hardware.nixosModules.dell-precision-5530
custom.inputs.nixos-hardware.nixosModules.common-gpu-nvidia
custom.inputs.nixos-hardware.nixosModules.common-gpu-intel
"${custom.inputs.self}/hardware/bluetooth"
(import "${custom.inputs.self}/modules/desktop" { inherit custom; })
"${custom.inputs.self}/modules/logs-share"
(import "${custom.inputs.self}/modules/restic-client-desktop" { inherit custom; })
@ -50,6 +49,7 @@
];
hardware = {
az_bluetooth.enable = true;
az_nvidia.enable = true;
dvd.enable = true;
};

View File

@ -4,7 +4,6 @@
custom.inputs.nixos-hardware.nixosModules.common-gpu-intel
custom.inputs.nixos-hardware.nixosModules.common-pc-laptop
custom.inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
"${custom.inputs.self}/hardware/bluetooth"
(import "${custom.inputs.self}/modules/desktop" { inherit custom; })
(import "${custom.inputs.self}/modules/docker" { inherit custom; })
(import "${custom.inputs.self}/modules/restic-client-desktop" { inherit custom; })
@ -43,6 +42,7 @@
];
hardware = {
az_bluetooth.enable = true;
dvd.enable = true;
};