43 lines
916 B
Nix
43 lines
916 B
Nix
{pkgs, ...}: {
|
|
services.secrets = {
|
|
enable = true;
|
|
|
|
vaultLogin = {
|
|
enable = true;
|
|
loginUsername = "hetzner-arm-container-music";
|
|
};
|
|
|
|
requiredVaultPaths = [
|
|
"api-keys/data/mpd"
|
|
"api-keys/data/music-stream"
|
|
];
|
|
|
|
packages = with pkgs; [
|
|
apacheHttpd
|
|
];
|
|
|
|
secrets = {
|
|
vault_password = {
|
|
manual = true;
|
|
};
|
|
|
|
mpd_control_password = {
|
|
user = "mpd";
|
|
group = "mpd";
|
|
fetchScript = ''
|
|
simple_get "/api-keys/mpd" .password > "$secretFile"
|
|
'';
|
|
};
|
|
music_stream_passwd = {
|
|
user = "nginx";
|
|
group = "nginx";
|
|
fetchScript = ''
|
|
username=$(simple_get "/api-keys/music-stream" .username)
|
|
password=$(simple_get "/api-keys/music-stream" .password)
|
|
htpasswd -bc "$secretFile" "$username" "$password" 2>/dev/null
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|