From 703ee70a4754995bf235ed9fb5318562207f76af Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 24 Jun 2024 00:27:54 +0200 Subject: [PATCH 1/6] Update bluetooth config --- hosts/herugrim/default.nix | 2 +- hosts/voyager/default.nix | 2 +- options/device/hardware.nix | 21 +++++++++++++++++++-- system/shared/hardware/bluetooth.nix | 6 +++--- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/hosts/herugrim/default.nix b/hosts/herugrim/default.nix index 5872cd2..894c92d 100644 --- a/hosts/herugrim/default.nix +++ b/hosts/herugrim/default.nix @@ -30,7 +30,6 @@ username = "itsdrike"; sound.enable = true; - bluetooth.enable = true; impermanence = { root = { @@ -61,6 +60,7 @@ cpu.type = "amd"; gpu.type = "hybrid-nvidia"; hasTPM = true; + bluetooth.enable = true; }; security = { diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index c83db29..8e17d6b 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -35,7 +35,6 @@ username = "itsdrike"; sound.enable = true; - bluetooth.enable = true; impermanence = { root = { @@ -115,6 +114,7 @@ cpu.type = "amd"; gpu.type = "amd"; hasTPM = true; + bluetooth.enable = true; }; security = { diff --git a/options/device/hardware.nix b/options/device/hardware.nix index 5b03a78..c097978 100644 --- a/options/device/hardware.nix +++ b/options/device/hardware.nix @@ -1,4 +1,5 @@ -{ lib, ... }: with lib; let +{ lib, ... }: let + inherit (lib) mkOption mkEnableOption types; in { options.myOptions.device = { @@ -34,9 +35,25 @@ in }; hasTPM = mkOption { - type = lib.types.bool; + type = types.bool; default = false; description = "Does this device have a TPM (Trusted Platform Module)?"; }; + + bluetooth = { + enable = mkEnableOption "bluetooth modules, drivers and configuration program(s)"; + powerOnBoot = mkOption { + type = types.bool; + default = false; + description = '' + Should bluetooth be powered on automatically during boot? + + This will worsen the battery life and is not recommended. Instead, you can + always turn bluetooth on manually once booted, when you need it. Unless you + have constant need for bluetooth / have some devices to connect to automatically + you, leave this off. + ''; + }; + }; }; } diff --git a/system/shared/hardware/bluetooth.nix b/system/shared/hardware/bluetooth.nix index f32fba8..a4ef4d1 100644 --- a/system/shared/hardware/bluetooth.nix +++ b/system/shared/hardware/bluetooth.nix @@ -6,14 +6,14 @@ }: let inherit (lib) mkIf; - sys = config.myOptions.system.bluetooth; + cfg = config.myOptions.device.bluetooth; in { - config = mkIf sys.enable { + config = mkIf cfg.enable { hardware.bluetooth = { enable = true; package = pkgs.bluez5-experimental; + powerOnBoot = cfg.powerOnBoot; #hsphfpd.enable = true; - powerOnBoot = true; disabledPlugins = ["sap"]; settings = { General = { From a38498eef2f570755372a9d15c673cb24fb62aac Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 24 Jun 2024 00:28:13 +0200 Subject: [PATCH 2/6] Credit spikespaz/dotfiles --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5fda9e2..c8e490c 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,5 @@ My NixOS and home-manager flake This configuration was massively inspired by the following amazing projects: - (major inspiration) +- - From 5cace9f1c09228a3abaac088a5116fc46d964d29 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 24 Jun 2024 00:27:54 +0200 Subject: [PATCH 3/6] Update bluetooth config --- hosts/herugrim/default.nix | 2 +- hosts/voyager/default.nix | 2 +- options/device/hardware.nix | 21 +++++++++++++++++++-- system/shared/hardware/bluetooth.nix | 6 +++--- system/shared/multimedia/sound/pipewire.nix | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/hosts/herugrim/default.nix b/hosts/herugrim/default.nix index 5872cd2..894c92d 100644 --- a/hosts/herugrim/default.nix +++ b/hosts/herugrim/default.nix @@ -30,7 +30,6 @@ username = "itsdrike"; sound.enable = true; - bluetooth.enable = true; impermanence = { root = { @@ -61,6 +60,7 @@ cpu.type = "amd"; gpu.type = "hybrid-nvidia"; hasTPM = true; + bluetooth.enable = true; }; security = { diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index c83db29..8e17d6b 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -35,7 +35,6 @@ username = "itsdrike"; sound.enable = true; - bluetooth.enable = true; impermanence = { root = { @@ -115,6 +114,7 @@ cpu.type = "amd"; gpu.type = "amd"; hasTPM = true; + bluetooth.enable = true; }; security = { diff --git a/options/device/hardware.nix b/options/device/hardware.nix index 5b03a78..c097978 100644 --- a/options/device/hardware.nix +++ b/options/device/hardware.nix @@ -1,4 +1,5 @@ -{ lib, ... }: with lib; let +{ lib, ... }: let + inherit (lib) mkOption mkEnableOption types; in { options.myOptions.device = { @@ -34,9 +35,25 @@ in }; hasTPM = mkOption { - type = lib.types.bool; + type = types.bool; default = false; description = "Does this device have a TPM (Trusted Platform Module)?"; }; + + bluetooth = { + enable = mkEnableOption "bluetooth modules, drivers and configuration program(s)"; + powerOnBoot = mkOption { + type = types.bool; + default = false; + description = '' + Should bluetooth be powered on automatically during boot? + + This will worsen the battery life and is not recommended. Instead, you can + always turn bluetooth on manually once booted, when you need it. Unless you + have constant need for bluetooth / have some devices to connect to automatically + you, leave this off. + ''; + }; + }; }; } diff --git a/system/shared/hardware/bluetooth.nix b/system/shared/hardware/bluetooth.nix index f32fba8..a4ef4d1 100644 --- a/system/shared/hardware/bluetooth.nix +++ b/system/shared/hardware/bluetooth.nix @@ -6,14 +6,14 @@ }: let inherit (lib) mkIf; - sys = config.myOptions.system.bluetooth; + cfg = config.myOptions.device.bluetooth; in { - config = mkIf sys.enable { + config = mkIf cfg.enable { hardware.bluetooth = { enable = true; package = pkgs.bluez5-experimental; + powerOnBoot = cfg.powerOnBoot; #hsphfpd.enable = true; - powerOnBoot = true; disabledPlugins = ["sap"]; settings = { General = { diff --git a/system/shared/multimedia/sound/pipewire.nix b/system/shared/multimedia/sound/pipewire.nix index 44ea9e6..5444256 100644 --- a/system/shared/multimedia/sound/pipewire.nix +++ b/system/shared/multimedia/sound/pipewire.nix @@ -9,7 +9,7 @@ inherit (lib.generators) toLua; cfg = config.myOptions.system.sound; - cfgBluetooth = config.myOptions.system.bluetooth; + cfgBluetooth = config.myOptions.device.bluetooth; in { config = mkIf cfg.enable { # in case pipewire was force disabled for whatever reason, fall From 8ee1bfd5e3d51fe81e0d221ccf1cc55a6dc6d46b Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 24 Jun 2024 00:29:42 +0200 Subject: [PATCH 4/6] Credit spikespaz/dotfiles --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5fda9e2..c8e490c 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,5 @@ My NixOS and home-manager flake This configuration was massively inspired by the following amazing projects: - (major inspiration) +- - From 64bafa5035ba5f2ef5f54273fa1b578ed7eb06db Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 24 Jun 2024 13:47:54 +0200 Subject: [PATCH 5/6] Add group lock keybind --- home/programs/graphical/wms/hyprland/config/keybinds.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/programs/graphical/wms/hyprland/config/keybinds.nix b/home/programs/graphical/wms/hyprland/config/keybinds.nix index f7301da..58d1d1d 100644 --- a/home/programs/graphical/wms/hyprland/config/keybinds.nix +++ b/home/programs/graphical/wms/hyprland/config/keybinds.nix @@ -85,6 +85,7 @@ # Window groups # "SUPER, G, togglegroup," + "SUPER_SHIFT, G, lockactivegroup, toggle" "ALT, tab, changegroupactive, f" "ALT, grave, changegroupactive, b" From ccf9ececa26e492223fb19bb9c7f757c1c31163f Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 24 Jun 2024 13:48:07 +0200 Subject: [PATCH 6/6] Reduce inactive dim strength --- home/programs/graphical/wms/hyprland/config/style.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/programs/graphical/wms/hyprland/config/style.nix b/home/programs/graphical/wms/hyprland/config/style.nix index 2607cca..12f25ee 100644 --- a/home/programs/graphical/wms/hyprland/config/style.nix +++ b/home/programs/graphical/wms/hyprland/config/style.nix @@ -99,7 +99,7 @@ decoration = { dim_inactive = false; # disabled for now - dim_strength = 0.05; + dim_strength = 0.02; dim_special = 0.2; inactive_opacity = 0.9; };