Fix some legacy version checking

This commit is contained in:
Victor Fuentes 2022-09-06 20:48:19 -04:00
parent de7f090e0d
commit 4f168a95b5
No known key found for this signature in database
GPG Key ID: 0A88B68D6A9ACAE0

View File

@ -325,20 +325,7 @@ fn setupprofilepkgscache() -> Result<(), Box<dyn Error>> {
// nix-instantiate --eval -E '(builtins.getFlake "/home/victor/nix").inputs.nixpkgs.outPath'
// nix-env -f /nix/store/sjmq1gphj1arbzf4aqqnygd9pf4hkfkf-source -qa --json > packages.json
fn setupupdatecache() -> Result<(), Box<dyn Error>> {
let vout = Command::new("nix-instantiate")
.arg("-I")
.arg("nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos")
.arg("<nixpkgs/lib>")
.arg("-A")
.arg("version")
.arg("--eval")
.arg("--json")
.output()?;
let dlver = String::from_utf8_lossy(&vout.stdout)
.to_string()
.replace('"', "");
// let dlver = fs::read_to_string("/run/current-system/nixos-version")?;
let dlver = fs::read_to_string("/run/current-system/nixos-version")?;
let mut relver = dlver.split('.').collect::<Vec<&str>>().join(".")[0..5].to_string();