fork/nix-index
git clone https://git.julia.blue/fork/nix-index
7ac9355
v0.1.3
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.3" ; 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 31postInstall = '' 32mkdir -p $ out /etc/profile.d 33cp ${ ./command-not-found.sh } $ out /etc/profile.d/command-not-found.sh 34substituteInPlace $ out /etc/profile.d/command-not-found.sh \ 35--replace "@out@" " $ out " 36'' ; 37 38meta = with lib ; { 39description = "A files database for nixpkgs" ; 40homepage = https://github.com/bennofs/nix-index ; 41license = with licenses ; [ bsd3 ]; 42maintainers = [ maintainers . bennofs ]; 43platforms = platforms . all ; 44}; 45}; 46}); 47checks = forAllSystems ( system :{ 48nix-index = self . packages . nix-index .${ system }; 49}); 50devShell = forAllSystems ( system :with nixpkgsFor .${ system }; stdenv . mkDerivation { 51name = "nix-index" ; 52 53RUST_SRC_PATH = " ${ pkgs . rust . packages . stable . rustPlatform . rustLibSrc } " ; 54 55nativeBuildInputs = [ rustc cargo pkg-config clippy rustfmt ]; 56buildInputs = [ openssl curl sqlite ] 57++ lib . optional stdenv . hostPlatform . isDarwin darwin . apple_sdk . frameworks . Security ; 58enableParallelBuilding = true ; 59}); 60apps = forAllSystems ( system :{ 61nix-index = { 62type = "app" ; 63program = " ${ self . packages .${ system }. default } /bin/nix-index" ; 64}; 65nix-locate = { 66type = "app" ; 67program = " ${ self . packages .${ system }. default } /bin/nix-locate" ; 68}; 69default = self . apps .${ system }. nix-locate ; 70}); 71}; 72}