#nix #nix-package #nixos #config-file #snowflakeos #nix-editor

nix-data

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

3 releases

0.0.3 Oct 30, 2023
0.0.2 Oct 12, 2022
0.0.1 Oct 6, 2022

#490 in Configuration

Download history 10/week @ 2024-07-06 12/week @ 2024-07-13 6/week @ 2024-07-20 13/week @ 2024-07-27 17/week @ 2024-08-03 1/week @ 2024-08-10 19/week @ 2024-08-17 9/week @ 2024-08-24 12/week @ 2024-08-31 8/week @ 2024-09-07 17/week @ 2024-09-14 29/week @ 2024-09-21 15/week @ 2024-09-28 12/week @ 2024-10-05 15/week @ 2024-10-12 6/week @ 2024-10-19

51 downloads per month

MIT license

53KB
1K SLoC

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);
        }
    }
}

Dependencies

~64MB
~1M SLoC