fork/nix-index
git clone https://git.julia.blue/fork/nix-index
70a0197
v0.1.7
1{ 2description = "A files database for nixpkgs" ; 3 4inputs = { 5nixpkgs . url = "nixpkgs/nixos-unstable" ; 6flake-compat = { 7url = "github:edolstra/flake-compat" ; 8flake = false ; 9}; 10}; 11 12outputs = { self , nixpkgs , flake-compat } : 13let 14inherit ( nixpkgs ) lib ; 15systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ]; 16forAllSystems = lib . genAttrs systems ; 17nixpkgsFor = nixpkgs . legacyPackages ; 18in 19{ 20packages = forAllSystems ( system :{ 21default = with nixpkgsFor .${ system }; rustPlatform . buildRustPackage { 22pname = "nix-index" ; 23inherit (( lib . importTOML ./Cargo.toml ). package ) version ; 24 25src = lib . sourceByRegex self [ 26"(examples|src)(/.*)?" 27''Cargo\.(toml|lock)'' 28''command-not-found\.sh'' 29]; 30 31cargoLock = { 32lockFile = ./Cargo.lock ; 33}; 34 35nativeBuildInputs = [ pkg-config ]; 36buildInputs = [ openssl curl sqlite ] 37++ lib . optionals stdenv . isDarwin [ darwin . apple_sdk . frameworks . Security ]; 38 39postInstall = '' 40substituteInPlace command-not-found.sh \ 41--subst-var out 42install -Dm555 command-not-found.sh -t $ out /etc/profile.d 43'' ; 44 45meta = with lib ; { 46description = "A files database for nixpkgs" ; 47homepage = "https://github.com/nix-community/nix-index" ; 48license = with licenses ; [ bsd3 ]; 49maintainers = [ maintainers . bennofs ]; 50}; 51}; 52}); 53 54checks = forAllSystems ( system :{ 55nix-index = self . packages .${ system }. default ; 56}); 57 58devShells = forAllSystems ( system :{ 59minimal = with nixpkgsFor .${ system }; mkShell { 60name = "nix-index" ; 61 62nativeBuildInputs = [ 63pkg-config 64]; 65 66buildInputs = [ 67openssl 68sqlite 69] ++ lib . optionals stdenv . isDarwin [ 70darwin . apple_sdk . frameworks . Security 71]; 72 73env . LD_LIBRARY_PATH = lib . makeLibraryPath [ openssl ]; 74}; 75 76default = with nixpkgsFor .${ system }; mkShell { 77name = "nix-index" ; 78 79inputsFrom = [ self . devShells .${ system }. minimal ]; 80 81nativeBuildInputs = [ rustc cargo clippy rustfmt ]; 82 83env = { 84LD_LIBRARY_PATH = lib . makeLibraryPath [ openssl ]; 85RUST_SRC_PATH = rustPlatform . rustLibSrc ; 86}; 87}; 88}); 89 90apps = forAllSystems ( system :{ 91nix-index = { 92type = "app" ; 93program = " ${ self . packages .${ system }. default } /bin/nix-index" ; 94}; 95nix-locate = { 96type = "app" ; 97program = " ${ self . packages .${ system }. default } /bin/nix-locate" ; 98}; 99default = self . apps .${ system }. nix-locate ; 100}); 101}; 102}