diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d8699d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +./secrets.nix \ No newline at end of file diff --git a/home-manager/default.nix b/home-manager/default.nix index f7b28f2..a3d4f6f 100755 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,11 +1,10 @@ -{ inputs, system, ... }: +{ inputs, system, secrets, ... }: { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; home-manager.extraSpecialArgs = { - inherit inputs; - inherit system; + inherit inputs system secrets; }; home-manager.backupFileExtension = "backup"; diff --git a/home-manager/home.nix b/home-manager/home.nix index a2faee8..d96f786 100755 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -16,5 +16,6 @@ ./modules/vscode.nix ./modules/desktop.nix ./modules/gtk.nix + ./modules/beets.nix ]; } \ No newline at end of file diff --git a/home-manager/modules/beets.nix b/home-manager/modules/beets.nix new file mode 100644 index 0000000..670f412 --- /dev/null +++ b/home-manager/modules/beets.nix @@ -0,0 +1,23 @@ +{ lib, secrets, ... }: +{ + programs.beets = { + enable = true; + + settings = { + directory = "~/Music"; + library = "~/Music/library.db"; + plugins = "fetchart lyrics lastgenre"; + + lyrics = { + synced = "yes"; + auto = "yes"; + force = "yes"; + sources = with secrets.programs.beets; lib.mkMerge [ + (lib.mkIf (google_api_key != null) "lrclib google genius tekstowo") + (lib.mkIf (google_api_key == null) "lrclib genius tekstowo") + ]; + google_API_key = with secrets.programs.beets; lib.mkIf (google_api_key != null) google_api_key; + }; + }; + }; +} \ No newline at end of file diff --git a/secrets.example.nix b/secrets.example.nix new file mode 100644 index 0000000..9c8fd3d --- /dev/null +++ b/secrets.example.nix @@ -0,0 +1,8 @@ +{ + programs = { + beets = { + # The API key to use for google custom search lyrics backend + google_api_key = null; + }; + }; +} \ No newline at end of file diff --git a/secrets.nix b/secrets.nix new file mode 100644 index 0000000..9e485ba --- /dev/null +++ b/secrets.nix @@ -0,0 +1,8 @@ +{ + programs = { + beets = { + # The API key to use for google custom search lyrics backend + google_api_key = "AIzaSyAWg0jEt2wPXNo2Q6dx2yvihT1FqkG26I4"; + }; + }; +} \ No newline at end of file