First attempt at both Rust and snix-castore. I'll start by putting together a single-file CLI app, no splitting modules out until needed, no separation of concerns. Currently, just the fetching is implemented: ``` $ sidx pkgs/dev*/cuda-*/cuda/manifests/*.json ```
51 lines
1.3 KiB
Nix
51 lines
1.3 KiB
Nix
{
|
|
npins ? import ./npins,
|
|
nixpkgs ? npins.nixpkgs,
|
|
pkgs ? import nixpkgs { },
|
|
lib ? pkgs.lib,
|
|
...
|
|
}:
|
|
|
|
lib.makeScope pkgs.newScope (
|
|
self:
|
|
let
|
|
addProtobuf = oldAttrs: {
|
|
nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [
|
|
(self.callPackage ({ protobuf }: protobuf) { })
|
|
];
|
|
};
|
|
in
|
|
{
|
|
sidx-crate2nix = (
|
|
self.callPackage ./Cargo.nix {
|
|
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
|
|
sidx = oldAttrs: {
|
|
src =
|
|
let
|
|
fs = pkgs.lib.fileset;
|
|
in
|
|
fs.toSource {
|
|
root = ./.;
|
|
fileset = fs.unions [
|
|
./src
|
|
./Cargo.toml
|
|
./Cargo.lock
|
|
];
|
|
};
|
|
};
|
|
snix-castore = addProtobuf;
|
|
# prost-wkt-types = addProtobuf;
|
|
# openssl-sys = oldAttrs: {
|
|
# nativeBuildInputs = oldAttrs.buildInputs or [ ] ++ [
|
|
# (self.callPackage ({ pkg-config }: pkg-config) { })
|
|
# ];
|
|
# buildInputs = oldAttrs.buildInputs or [ ] ++ [
|
|
# (self.callPackage ({ openssl }: openssl) { })
|
|
# ];
|
|
# };
|
|
};
|
|
}
|
|
);
|
|
sidx = self.sidx-crate2nix.rootCrate.build;
|
|
}
|
|
)
|