fork/nix-index
git clone https://git.julia.blue/fork/nix-index
97eefd9
v0.1.5
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 } :let 13systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ]; 14forAllSystems = f :nixpkgs . lib . genAttrs systems ( system :f system ); 15nixpkgsFor = forAllSystems ( system :import nixpkgs { inherit system ; }); 16in { 17packages = forAllSystems ( system :{ 18default = with nixpkgsFor .${ system }; rustPlatform . buildRustPackage { 19pname = "nix-index" ; 20version = "0.1.5" ; 21 22src = self ; 23 24nativeBuildInputs = [ pkg-config ]; 25buildInputs = [ openssl curl sqlite ] 26++ lib . optionals stdenv . hostPlatform . isDarwin [ darwin . apple_sdk . frameworks . Security libiconv ]; 27cargoLock = { 28lockFile = ./Cargo.lock ; 29}; 30 31preUnpack = '' 32mkdir tmp 33cp -pr -L --reflink=auto -- " $ cargoDeps " "tmp/ $( stripHash " $ cargoDeps " ) " 34chmod -R a+w "tmp/ $( stripHash " $ cargoDeps " ) " 35export cargoDeps =" $( pwd ) /tmp/ $( stripHash " $ cargoDeps " ) " 36'' ; 37 38postInstall = '' 39mkdir -p $ out /etc/profile.d 40cp ${ ./command-not-found.sh } $ out /etc/profile.d/command-not-found.sh 41substituteInPlace $ out /etc/profile.d/command-not-found.sh \ 42--replace "@out@" " $ out " 43'' ; 44 45meta = with lib ; { 46description = "A files database for nixpkgs" ; 47homepage = https://github.com/bennofs/nix-index ; 48license = with licenses ; [ bsd3 ]; 49maintainers = [ maintainers . bennofs ]; 50platforms = platforms . all ; 51}; 52}; 53}); 54checks = forAllSystems ( system :{ 55nix-index = self . packages . nix-index .${ system }; 56}); 57devShell = forAllSystems ( system :with nixpkgsFor .${ system }; stdenv . mkDerivation { 58name = "nix-index" ; 59 60RUST_SRC_PATH = " ${ pkgs . rust . packages . stable . rustPlatform . rustLibSrc } " ; 61 62nativeBuildInputs = [ rustc cargo pkg-config clippy rustfmt ]; 63buildInputs = [ openssl curl sqlite ] 64++ lib . optional stdenv . hostPlatform . isDarwin darwin . apple_sdk . frameworks . Security ; 65enableParallelBuilding = true ; 66}); 67apps = forAllSystems ( system :{ 68nix-index = { 69type = "app" ; 70program = " ${ self . packages .${ system }. default } /bin/nix-index" ; 71}; 72nix-locate = { 73type = "app" ; 74program = " ${ self . packages .${ system }. default } /bin/nix-locate" ; 75}; 76default = self . apps .${ system }. nix-locate ; 77}); 78}; 79}