From 034cd3ac550f5aa8bc5606f87d15ab911bcad42d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 3 Jan 2024 16:51:34 +0000 Subject: [PATCH] common: profiles: migrate bluetooth --- modules/common/profiles/bluetooth/default.nix | 19 +++++++++++++++++++ modules/common/profiles/default.nix | 2 +- modules/nixos/profiles/bluetooth/default.nix | 15 --------------- modules/nixos/profiles/default.nix | 1 - 4 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 modules/common/profiles/bluetooth/default.nix delete mode 100644 modules/nixos/profiles/bluetooth/default.nix diff --git a/modules/common/profiles/bluetooth/default.nix b/modules/common/profiles/bluetooth/default.nix new file mode 100644 index 0000000..bfb8bfc --- /dev/null +++ b/modules/common/profiles/bluetooth/default.nix @@ -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; + }) + ]); +} diff --git a/modules/common/profiles/default.nix b/modules/common/profiles/default.nix index 06511ac..a71f3be 100644 --- a/modules/common/profiles/default.nix +++ b/modules/common/profiles/default.nix @@ -2,6 +2,6 @@ { ... }: { imports = [ - # FIXME: empty + ./bluetooth ]; } diff --git a/modules/nixos/profiles/bluetooth/default.nix b/modules/nixos/profiles/bluetooth/default.nix deleted file mode 100644 index 292d0d1..0000000 --- a/modules/nixos/profiles/bluetooth/default.nix +++ /dev/null @@ -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; - }; -} diff --git a/modules/nixos/profiles/default.nix b/modules/nixos/profiles/default.nix index 43d5a84..c442eec 100644 --- a/modules/nixos/profiles/default.nix +++ b/modules/nixos/profiles/default.nix @@ -2,7 +2,6 @@ { ... }: { imports = [ - ./bluetooth ./devices ./gtk ./laptop