dendrify: comfy-station
This commit is contained in:
36
old/modules/programs/spotify-shortcuts.nix
Normal file
36
old/modules/programs/spotify-shortcuts.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.programs.spotify-shortcuts;
|
||||
in {
|
||||
options.hive.programs.spotify-shortcuts = {
|
||||
enable = lib.mkEnableOption "Enable Spotify Shortcuts";
|
||||
clientIdSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "Spotify API Client ID sops secret name";
|
||||
};
|
||||
clientSecretSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "Spotify API Client Secret Path sops secret name";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [pkgs.hive.spotify-shortcuts];
|
||||
environment.variables = {
|
||||
SPOTIFY_SHORTCUTS_CONFIG = config.sops.templates."spotify-shortcuts-client.json".path;
|
||||
};
|
||||
sops.templates."spotify-shortcuts-client.json" = {
|
||||
mode = "444";
|
||||
content = ''
|
||||
{
|
||||
"clientId": "${config.sops.placeholder.${cfg.clientIdSopsKey}}",
|
||||
"clientSecret": "${config.sops.placeholder.${cfg.clientSecretSopsKey}}"
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user