Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Nix-PKGS #52

Open
CelestifyX opened this issue Feb 23, 2025 · 3 comments
Open

Add support for Nix-PKGS #52

CelestifyX opened this issue Feb 23, 2025 · 3 comments
Labels
enhancement New unique feature or request.

Comments

@CelestifyX
Copy link

Pls, add support for NIXOS Package Manager (Count packages) :)

@CelestifyX CelestifyX added the enhancement New unique feature or request. label Feb 23, 2025
@CelestifyX
Copy link
Author

CelestifyX commented Feb 26, 2025

@LivacoNew

use std::env;
use std::process::Command;

fn process_nix_system_packages() -> Option<u64> {
    let output = Command::new("nix-store").args(&["-q", "--requisites", "/run/current-system/sw"]).output().ok()?;
    Some(output.stdout.lines().count() as u64)
}

fn process_nix_user_packages() -> Option<u64> {
    let home_dir = env::var("HOME").ok()?;
    let output   = Command::new("nix-store").args(&["-q", "--requisites", &format!("{}/.nix-profile", home_dir)]).output().ok()?;

    Some(output.stdout.lines().count() as u64)
}

@LivacoNew
Copy link
Owner

Not gonna go down the path of using commands before eliminating caches or package databases like other managers, installing a VM as we speak to play around with it.

@CelestifyX
Copy link
Author

Yes, but there is no other way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New unique feature or request.
Projects
None yet
Development

No branches or pull requests

2 participants