nix-data

Crates.ionix-data
lib.rsnix-data
version0.0.3
sourcesrc
created_at2022-10-06 23:22:41.937773
updated_at2023-10-30 14:37:40.084436
descriptionA set of modules for easily managing Nix and NixOS packages and options
homepage
repositoryhttps://github.com/snowflakelinux/nix-data/
max_upload_size
id681649
size54,003
Victor Fuentes (vlinkz)

documentation

README

Nix Data

crates.io Built with Nix License: MIT

A set of modules for easily managing Nix and NixOS packages and options.

This crate contains a cache module for caching Nix/NixOS packages and options, such as the latest packages.json and options.json from the NixOS cache.

This crate also contains a config module for maintaining a set of important Nix/NixOS details, such as the location of the users configuration.nix file, and whether they are using flakes or not. This can be useful so that not ever application/utility needs to maintain their own config files and preferences.

Example

extern crate nix_data;
 
fn main() {
    let userpkgs = nix_data::cache::profile::getprofilepkgs_versioned();
    if let Ok(pkgs) = userpkgs {
        println!("List of installed nix profile packages");
        println!("===");
        for (pkg, version) in pkgs {
            println!("{}: {}", pkg, version);
        }
    }
}
Commit count: 36

cargo fmt