packages/spotify-adblock: update cargo hash and patch

This commit is contained in:
LavaDesu 2023-06-18 22:57:50 +07:00
parent 416aa9e921
commit 466a79e619
Signed by: cilly
GPG key ID: 6500251E087653C9
2 changed files with 2 additions and 10 deletions

View file

@ -11,19 +11,11 @@ diff --git a/src/lib.rs b/src/lib.rs
index 5a0d7bd961e..86f2ac04ebf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,6 +7,7 @@ use lazy_static::lazy_static;
use libc::{addrinfo, c_char, dlsym, EAI_FAIL, RTLD_NEXT};
use regex::Regex;
use serde::Deserialize;
+use std::env;
use std::ffi::CStr;
use std::fs::read_to_string;
use std::mem;
@@ -44,6 +45,7 @@ struct Config {
lazy_static! {
static ref CONFIG: Config = {
let config_paths = vec![
+ PathBuf::from(env::var("SPOTIFY_ADBLOCK_CONFIG").unwrap_or("".into())),
+ PathBuf::from(std::env::var("SPOTIFY_ADBLOCK_CONFIG").unwrap_or("".into())),
PathBuf::from("config.toml"),
#[allow(deprecated)] // std::env::home_dir() is only broken on Windows
std::env::home_dir().unwrap().join(".config/spotify-adblock/config.toml"),

View file

@ -7,7 +7,7 @@ rustPlatform.buildRustPackage {
version = "1.0";
src = inputs.spotify-adblock;
cargoSha256 = "sha256-07vswkW0BZCEg8Z/cS71bbkJ546k+YI38HN5bdIqTPU=";
cargoSha256 = "sha256-t8OVQEp4M0H7gTGaP/2KBChRvAyhWCWV+6d/tPXa3/k=";
patches = [ ./0002-allow-setting-config-from-environment-variable.patch ];