move monolith
This commit is contained in:
@@ -1,9 +1,56 @@
|
||||
{
|
||||
{self, ...}: {
|
||||
flake.overlays.spotify-shortcuts = final: prev: {
|
||||
bulk-transcode = final.callPackage ./_derivation.nix {};
|
||||
spotify-shortcuts = final.callPackage ./_derivation.nix {};
|
||||
};
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.spotify-shortcuts = pkgs.callPackage ./_derivation.nix {};
|
||||
devShells.spotify-shortcuts = import ./_shell.nix {inherit pkgs;};
|
||||
};
|
||||
|
||||
flake.nixosModules.spotify-shortcuts-overlay = {
|
||||
nixpkgs.overlays = [
|
||||
self.overlays.spotify-shortcuts
|
||||
];
|
||||
};
|
||||
|
||||
flake.nixosModules.spotify-shortcuts = {
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
self.nixosModules.spotify-shortcuts-overlay
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [pkgs.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