fix: build error on nix

this happened because nixpkgs doens't yet have the latest nightly rust
This commit is contained in:
Vladimir Rubin 2025-06-14 20:46:34 +03:00
parent ba0bfc7dad
commit d0a2cc22c0
Signed by: vavakado
GPG key ID: CAB744727F36B524

View file

@ -34,8 +34,8 @@ async fn config_reloader(notify: Arc<Notify>) {
loop { loop {
trace!("config poll tick"); trace!("config poll tick");
let config_path = get_config_path(); let config_path = get_config_path();
if config_path.exists() if config_path.exists() {
&& let Ok(current_modified) = std::fs::metadata(&config_path) if let Ok(current_modified) = std::fs::metadata(&config_path)
.and_then(|m| m.modified()) .and_then(|m| m.modified())
.map(|t| t.duration_since(UNIX_EPOCH).unwrap().as_secs()) .map(|t| t.duration_since(UNIX_EPOCH).unwrap().as_secs())
{ {
@ -53,6 +53,7 @@ async fn config_reloader(notify: Arc<Notify>) {
reload_config(Arc::clone(&notify)).await; reload_config(Arc::clone(&notify)).await;
} }
} }
}
sleep(Duration::from_secs(5)).await; sleep(Duration::from_secs(5)).await;
} }
} }
@ -136,14 +137,20 @@ async fn socket_server(
let now = !disabled_temp.load(Ordering::SeqCst); let now = !disabled_temp.load(Ordering::SeqCst);
disabled_temp.store(now, Ordering::SeqCst); disabled_temp.store(now, Ordering::SeqCst);
notify.notify_one(); notify.notify_one();
debug!("temp dimming is {}", if now { "enabled" } else { "disabled" }); debug!(
"temp dimming is {}",
if now { "enabled" } else { "disabled" }
);
} }
"toggle_gamma" => { "toggle_gamma" => {
trace!("toggle_gamma dispatched"); trace!("toggle_gamma dispatched");
let now = !disabled_gamma.load(Ordering::SeqCst); let now = !disabled_gamma.load(Ordering::SeqCst);
disabled_gamma.store(now, Ordering::SeqCst); disabled_gamma.store(now, Ordering::SeqCst);
notify.notify_one(); notify.notify_one();
debug!("gamma dimming is {}", if now { "enabled" } else { "disabled" }); debug!(
"gamma dimming is {}",
if now { "enabled" } else { "disabled" }
);
} }
"toggle" => { "toggle" => {
trace!("toggle dispatched"); trace!("toggle dispatched");