System Gen84 @ 2025-07-24-02:00:39 by jonas@monolith
This commit is contained in:
28
modules/programs/spotify-shortcuts.nix
Normal file
28
modules/programs/spotify-shortcuts.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.programs.spotify-shortcuts;
|
||||
in {
|
||||
options.hive.programs.spotify-shortcuts = {
|
||||
enable = lib.mkEnableOption "Enable Spotify Shortcuts";
|
||||
clientIdFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Spotify API Client ID Path";
|
||||
};
|
||||
clientSecretFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Spotify API Client Secret Path";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [pkgs.hive.spotify-shortcuts];
|
||||
environment.etc."profile.d/spotify-shortcuts.sh".text = ''
|
||||
export SPOTIFY_SHORTCUTS_CLIENT_ID=$(cat ${cfg.clientIdFile})
|
||||
export SPOTIFY_SHORTCUTS_CLIENT_SECRET=$(cat ${cfg.clientSecretFile})
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user