From b4dfc0ec5365b139b4ba48b1610622c1411003d8 Mon Sep 17 00:00:00 2001 From: vitrial Date: Fri, 11 Oct 2024 00:07:35 -0400 Subject: [PATCH] bluetooth automation --- .gitignore | 1 + nixos/modules/bluetooth.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1093752 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +nixos/hardware-configuration.nix diff --git a/nixos/modules/bluetooth.nix b/nixos/modules/bluetooth.nix index 88433ee..a5eda4b 100644 --- a/nixos/modules/bluetooth.nix +++ b/nixos/modules/bluetooth.nix @@ -9,4 +9,17 @@ hardware.bluetooth.powerOnBoot = true; services.blueman.enable = true; + + systemd.user.services.auto-bluetooth = { + description = "auto-bluetooth"; + serviceConfig = { + Type = "forking"; + ExecStart = "/home/vitrial/.local/bin/bluetooth-autoconnect"; + ExecStop = "pkill bluetooth-autoconnect"; + Restart = "on-failure"; + }; + wantedBy = [ "default.target" ]; + }; + + systemd.services.auto-bluetooth.enable = true; }