Patch hddtemp Nix store path
This commit is contained in:
parent
185c97e30e
commit
54c63e8cf4
2 changed files with 5 additions and 5 deletions
|
@ -63,6 +63,9 @@ rust-project TODO: write shell script for automatically updating `cargoHash`
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
buildAndTestSubdir = "status_cloud";
|
buildAndTestSubdir = "status_cloud";
|
||||||
cargoHash = "sha256-mMxHI/rU1Gd5UR+hZ+5+FnBrff8uF+SrEvGJT7wh5tI=";
|
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 // {
|
meta = meta // {
|
||||||
description = "Server status saved to a nextcloud note service.";
|
description = "Server status saved to a nextcloud note service.";
|
||||||
};
|
};
|
||||||
|
@ -104,7 +107,7 @@ rust-project TODO: write shell script for automatically updating `cargoHash`
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = ''
|
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}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -63,7 +63,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let mut drive_temps: Vec<String> = vec![];
|
let mut drive_temps: Vec<String> = vec![];
|
||||||
|
|
||||||
for drive in drives {
|
for drive in drives {
|
||||||
let output = match Command::new(&args.hddtemp_executable)
|
let output = match Command::new("hddtemp")
|
||||||
.arg("--unit=F")
|
.arg("--unit=F")
|
||||||
.arg(&drive)
|
.arg(&drive)
|
||||||
.output()
|
.output()
|
||||||
|
@ -137,9 +137,6 @@ struct CliArgs {
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
config_file: PathBuf,
|
config_file: PathBuf,
|
||||||
|
|
||||||
#[arg(short, long)]
|
|
||||||
hddtemp_executable: String,
|
|
||||||
|
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
debug: bool,
|
debug: bool,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue