From 54c63e8cf4e9500f3e3006ef1049350cac6ee2bc Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 26 Aug 2023 12:30:06 -0700 Subject: [PATCH] Patch hddtemp Nix store path --- flake.nix | 5 ++++- status_cloud/src/main.rs | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index ae418eb..d91f0a3 100644 --- a/flake.nix +++ b/flake.nix @@ -63,6 +63,9 @@ rust-project TODO: write shell script for automatically updating `cargoHash` version = "0.1.0"; buildAndTestSubdir = "status_cloud"; cargoHash = "sha256-mMxHI/rU1Gd5UR+hZ+5+FnBrff8uF+SrEvGJT7wh5tI="; + preBuild = '' + sed -i 's/Command::new("hddtemp")/${nixpkgs.lib.escape [ "/" ] "Command::new(\"${pkgs.hddtemp}\")"}/g' status_cloud/src/main.rs + ''; meta = meta // { description = "Server status saved to a nextcloud note service."; }; @@ -104,7 +107,7 @@ rust-project TODO: write shell script for automatically updating `cargoHash` serviceConfig = { Type = "oneshot"; ExecStart = '' - ${cfg.package}/bin/status_cloud --hddtemp-executable ${pkgs.hddtemp}/bin/hddtemp --config-file ${builtins.toString cfg.config_path} + ${cfg.package}/bin/status_cloud --config-file ${builtins.toString cfg.config_path} ''; }; }; diff --git a/status_cloud/src/main.rs b/status_cloud/src/main.rs index 5391d91..f160bb5 100644 --- a/status_cloud/src/main.rs +++ b/status_cloud/src/main.rs @@ -63,7 +63,7 @@ fn main() -> Result<(), Box> { let mut drive_temps: Vec = vec![]; for drive in drives { - let output = match Command::new(&args.hddtemp_executable) + let output = match Command::new("hddtemp") .arg("--unit=F") .arg(&drive) .output() @@ -137,9 +137,6 @@ struct CliArgs { #[arg(short, long)] config_file: PathBuf, - #[arg(short, long)] - hddtemp_executable: String, - #[arg(short, long)] debug: bool, }