From a4cacfd4dee12d0defd1d4a9c2c04561ff36013f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 5 Apr 2025 09:00:00 +0100 Subject: [PATCH] Extract a bluetooth mixin --- home/opdavies/hosts/t480.nix | 1 - home/opdavies/hosts/t490.nix | 1 - hosts/t480/configuration.nix | 3 ++- hosts/t480/hardware.nix | 5 ---- hosts/t480/services/default.nix | 2 -- modules/home-manager/cli/default.nix | 1 - .../bluetuith.nix => mixins/bluetooth.nix} | 23 ++++++++----------- 7 files changed, 12 insertions(+), 24 deletions(-) delete mode 100644 hosts/t480/hardware.nix rename modules/{home-manager/cli/bluetuith.nix => mixins/bluetooth.nix} (60%) diff --git a/home/opdavies/hosts/t480.nix b/home/opdavies/hosts/t480.nix index c6c6f0fc..251ccdd9 100644 --- a/home/opdavies/hosts/t480.nix +++ b/home/opdavies/hosts/t480.nix @@ -2,7 +2,6 @@ { homeManagerModules = { - bluetuith.enable = true; direnv.enable = true; discord.enable = true; dwm.enable = true; diff --git a/home/opdavies/hosts/t490.nix b/home/opdavies/hosts/t490.nix index d89c7027..aca09275 100644 --- a/home/opdavies/hosts/t490.nix +++ b/home/opdavies/hosts/t490.nix @@ -2,7 +2,6 @@ { homeManagerModules = { - bluetuith.enable = true; direnv.enable = true; discord.enable = true; dwm.enable = true; diff --git a/hosts/t480/configuration.nix b/hosts/t480/configuration.nix index be333157..8cbc77e8 100644 --- a/hosts/t480/configuration.nix +++ b/hosts/t480/configuration.nix @@ -3,12 +3,13 @@ { imports = [ ./hardware-configuration.nix - ./hardware.nix ./programs.nix ./secrets.nix ./services ./users.nix + ../../modules/mixins/bluetooth.nix + ./modules/docker.nix ../common diff --git a/hosts/t480/hardware.nix b/hosts/t480/hardware.nix deleted file mode 100644 index 3798ca48..00000000 --- a/hosts/t480/hardware.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - hardware = { - bluetooth.enable = true; - }; -} diff --git a/hosts/t480/services/default.nix b/hosts/t480/services/default.nix index ef7c3c7b..53c2e88a 100644 --- a/hosts/t480/services/default.nix +++ b/hosts/t480/services/default.nix @@ -17,8 +17,6 @@ openFirewall = true; }; - blueman.enable = true; - gvfs.enable = true; openssh.enable = true; power-profiles-daemon.enable = false; diff --git a/modules/home-manager/cli/default.nix b/modules/home-manager/cli/default.nix index 3394e79a..444b3fe5 100644 --- a/modules/home-manager/cli/default.nix +++ b/modules/home-manager/cli/default.nix @@ -3,7 +3,6 @@ { imports = [ ./bin - ./bluetuith.nix ./direnv.nix ./fzf.nix ./git.nix diff --git a/modules/home-manager/cli/bluetuith.nix b/modules/mixins/bluetooth.nix similarity index 60% rename from modules/home-manager/cli/bluetuith.nix rename to modules/mixins/bluetooth.nix index fbb35852..e2fc375c 100644 --- a/modules/home-manager/cli/bluetuith.nix +++ b/modules/mixins/bluetooth.nix @@ -1,20 +1,15 @@ -{ - config, - lib, - pkgs, - ... -}: - -with lib; +{ pkgs, ... }: { - options.homeManagerModules.bluetuith.enable = mkEnableOption "Enable bluetuith"; + hardware.bluetooth.enable = true; - config = mkIf config.homeManagerModules.bluetuith.enable { - home.packages = with pkgs; [ - bluetuith - ]; + services.blueman.enable = true; + environment.systemPackages = with pkgs; [ + bluetuith + ]; + + home-manager.users.opdavies = { xdg.configFile."bluetuith/bluetuith.conf" = { text = '' { @@ -23,10 +18,12 @@ with lib; connect-bdaddr: "" gsm-apn: "" gsm-number: "" + keybindings: { NavigateDown: j NavigateUp: k } + receive-dir: "" theme: {} }