diff --git a/nix/configuration/configuration.nix b/nix/configuration/configuration.nix index 29bbbe7..076fd14 100644 --- a/nix/configuration/configuration.nix +++ b/nix/configuration/configuration.nix @@ -58,6 +58,7 @@ ./roles/memtest86 ./roles/kodi ./roles/ansible + ./roles/bluetooth ]; nix.settings.experimental-features = [ diff --git a/nix/configuration/hosts/neelix/default.nix b/nix/configuration/hosts/neelix/default.nix index 34713d2..b3b0443 100644 --- a/nix/configuration/hosts/neelix/default.nix +++ b/nix/configuration/hosts/neelix/default.nix @@ -29,4 +29,5 @@ me.graphicsCardType = "intel"; me.kodi.enable = true; + me.bluetooth.enable = true; } diff --git a/nix/configuration/roles/bluetooth/default.nix b/nix/configuration/roles/bluetooth/default.nix new file mode 100644 index 0000000..eb026c6 --- /dev/null +++ b/nix/configuration/roles/bluetooth/default.nix @@ -0,0 +1,46 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ ]; + + options.me = { + bluetooth.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install bluetooth."; + }; + }; + + config = lib.mkIf config.me.bluetooth.enable ( + lib.mkMerge [ + { + environment.systemPackages = with pkgs; [ + ]; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + # Enable support for showing battery charge level. + Experimental = true; + }; + }; + }; + + environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) { + hideMounts = true; + directories = [ + "/var/lib/bluetooth" # Bluetooth pairing information. + ]; + }; + } + ] + ); +} diff --git a/nix/configuration/roles/kodi/default.nix b/nix/configuration/roles/kodi/default.nix index c2249a4..39be875 100644 --- a/nix/configuration/roles/kodi/default.nix +++ b/nix/configuration/roles/kodi/default.nix @@ -28,16 +28,16 @@ services.cage.program = "${pkgs.kodi-wayland}/bin/kodi-standalone"; services.cage.enable = true; - # nixpkgs.overlays = [ - # (final: prev: { - # kodi-wayland = prev.kodi-wayland.withPackages ( - # kodiPkgs: with kodiPkgs; [ - # joystick - # vfs-sftp - # ] - # ); - # }) - # ]; + nixpkgs.overlays = [ + (final: prev: { + kodi-wayland = prev.kodi-wayland.withPackages ( + kodiPkgs: with kodiPkgs; [ + joystick + vfs-sftp + ] + ); + }) + ]; users.users.kodi = { isNormalUser = true;