diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 559ef6e..2bea1a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,10 +6,10 @@ on: - main - master schedule: - # rebuild everyday at 2:51 + # rebuild everyday at 4:55 # TIP: Choose a random time here so not all repositories are build at once: # https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new - - cron: '51 2 * * *' + - cron: '55 4 * * *' jobs: tests: strategy: @@ -20,7 +20,7 @@ jobs: # The repo name as used in # https://github.com/nix-community/NUR/blob/master/repos.json nurRepo: - - + - 'fliegendewurst' # Set this to cache your build results in cachix for faster builds # in CI and for everyone who uses your cache. # @@ -31,8 +31,8 @@ jobs: # CACHIX_AUTH_TOKEN secret in your repository secrets settings in # Github found at # https://github.com//nur-packages/settings/secrets - cachixName: - - + #cachixName: + # - nixPath: - nixpkgs=channel:nixos-unstable - nixpkgs=channel:nixpkgs-unstable @@ -53,14 +53,14 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - name: Show nixpkgs version run: nix-instantiate --eval -E '(import {}).lib.version' - - name: Setup cachix - uses: cachix/cachix-action@v10 - # Don't replace here! - if: ${{ matrix.cachixName != '' }} - with: - name: ${{ matrix.cachixName }} - signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + #- name: Setup cachix + # uses: cachix/cachix-action@v10 + # # Don't replace here! + # if: ${{ matrix.cachixName != '' }} + # with: + # name: ${{ matrix.cachixName }} + # signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' + # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Check evaluation run: | nix-env -f . -qa \* --meta --xml \ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ef6bb32..0000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: ~> 1.0 -import: nix-community/nix-travis-ci:nix.yml@main - -sudo: false - -env: - global: - # Set this to cache your build results in cachix for faster builds - # in travis and for everyone who uses your cache. - # - # Format: Your cachix cache host name without the ".cachix.org" suffix. - # Example: mycache (for mycache.cachix.org) - # - # For this to work, you also need to set the CACHIX_SIGNING_KEY - # in your repository settings in Travis. - # - CACHIX_CACHE= - # Set this to notify the global nur package registry that changes are - # available. - # - # The repo name as used in - # https://github.com/nix-community/NUR/blob/master/repos.json - - NUR_REPO="" - -matrix: - include: - - env: NIX_PATH=nixpkgs=channel:nixpkgs-unstable - - env: NIX_PATH=nixpkgs=channel:nixos-unstable - - env: NIX_PATH=nixpkgs=channel:nixos-20.03 - -script: - - nix-build ci.nix -A buildOutputs - - nix eval -f default.nix 'lib' - - nix eval -f default.nix 'modules' - - nix eval -f default.nix 'overlays' - -after_success: - - if [ -n "${CACHIX_CACHE}" ]; then nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}"; fi - - if [[ NUR_REPO != "" && "cron" != "${TRAVIS_EVENT_TYPE}" && "false" = "${TRAVIS_PULL_REQUEST}" && "master" = "${TRAVIS_BRANCH}" ]]; then - curl -XPOST "https://nur-update.herokuapp.com/update?repo=${NUR_REPO}"; fi - diff --git a/LICENSE b/LICENSE index 212cbf2..5fdd880 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Francesco Gazzetta +Copyright (c) 2018 Francesco Gazzetta, Arne Keller Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 077cfbc..9437174 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,9 @@ -# nur-packages-template - -**A template for [NUR](https://github.com/nix-community/NUR) repositories** - -## Setup - -1. Click on [Use this template](https://github.com/nix-community/nur-packages-template/generate) to start a repo based on this template. (Do _not_ fork it.) -2. Add your packages to the [pkgs](./pkgs) directory and to - [default.nix](./default.nix) - * Remember to mark the broken packages as `broken = true;` in the `meta` - attribute, or travis (and consequently caching) will fail! - * Library functions, modules and overlays go in the respective directories -3. Choose your CI: Depending on your preference you can use github actions (recommended) or [Travis ci](https://travis-ci.com). - - Github actions: Change your NUR repo name and optionally add a cachix name in [.github/workflows/build.yml](./.github/workflows/build.yml) and change the cron timer - to a random value as described in the file - - Travis ci: Change your NUR repo name and optionally your cachix repo name in - [.travis.yml](./.travis.yml). Than enable travis in your repo. You can add a cron job in the repository settings on travis to keep your cachix cache fresh -5. Change your travis and cachix names on the README template section and delete - the rest -6. [Add yourself to NUR](https://github.com/nix-community/NUR#how-to-add-your-own-repository) - -## README template - # nur-packages **My personal [NUR](https://github.com/nix-community/NUR) repository** - -![Build and populate cache](https://github.com//nur-packages/workflows/Build%20and%20populate%20cache/badge.svg) +![Build and populate cache](https://github.com/FliegendeWurst/nur-packages/workflows/Build%20and%20populate%20cache/badge.svg) [![Cachix Cache](https://img.shields.io/badge/cachix--blue.svg)](https://.cachix.org) - +--> diff --git a/default.nix b/default.nix index d6497c9..9436414 100644 --- a/default.nix +++ b/default.nix @@ -14,7 +14,9 @@ modules = import ./modules; # NixOS modules overlays = import ./overlays; # nixpkgs overlays - example-package = pkgs.callPackage ./pkgs/example-package { }; + ripgrep-all = pkgs.callPackage ./pkgs/ripgrep-all { + inherit (pkgs.darwin.apple_sdk.frameworks) Security; + }; # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; # ... } diff --git a/pkgs/example-package/default.nix b/pkgs/example-package/default.nix deleted file mode 100644 index 41e22df..0000000 --- a/pkgs/example-package/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ stdenv }: - -stdenv.mkDerivation rec { - name = "example-package-${version}"; - version = "1.0"; - src = ./.; - buildPhase = "echo echo Hello World > example"; - installPhase = "install -Dm755 example $out"; -} diff --git a/pkgs/ripgrep-all/default.nix b/pkgs/ripgrep-all/default.nix new file mode 100644 index 0000000..699555a --- /dev/null +++ b/pkgs/ripgrep-all/default.nix @@ -0,0 +1,64 @@ +{ stdenv, lib, fetchFromGitHub, rustPlatform, makeWrapper +, pandoc, poppler_utils, ripgrep, Security +}: + +rustPlatform.buildRustPackage rec { + pname = "ripgrep-all"; + version = "0.9.7-infdev"; + + src = fetchFromGitHub { + owner = "FliegendeWurst"; + repo = pname; + rev = "ca0191c38ed0c3ef6dc733bd3c4d4359ff4fb522"; + sha256 = "0fkkpk82bd9bm184nmcx6vn1pqwc9z0abr6wsfr6vkd6vm3184ca"; + }; + + cargoSha256 = "1z1008yyhzch92740bcs4mn5l0b2y7z3h2vjp5vh2qk99byh6ydm"; + nativeBuildInputs = [ makeWrapper ]; + buildInputs = lib.optional stdenv.isDarwin Security; + + postInstall = '' + wrapProgram $out/bin/rga \ + --prefix PATH ":" "${lib.makeBinPath [ pandoc poppler_utils ripgrep ]}" + ''; + + # Use upstream's example data to run a couple of queries to ensure the dependencies + # for all of the adapters are available. + installCheckPhase = '' + set -e + export PATH="$PATH:$out/bin" + + test1=$(rga --rga-no-cache "hello" exampledir/ | wc -l) + test2=$(rga --rga-no-cache --rga-adapters=tesseract "crate" exampledir/screenshot.png | wc -l) + + if [ $test1 != 26 ] + then + echo "ERROR: test1 failed! Could not find the word 'hello' 26 times in the sample data." + exit 1 + fi + + if [ $test2 != 1 ] + then + echo "ERROR: test2 failed! Could not find the word 'crate' in the screenshot." + exit 1 + fi + ''; + + doInstallCheck = false; + doCheck = false; # ... + + meta = with lib; { + description = "Ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, and more"; + longDescription = '' + Ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc. + + rga is a line-oriented search tool that allows you to look for a regex in + a multitude of file types. rga wraps the awesome ripgrep and enables it + to search in pdf, docx, sqlite, jpg, movie subtitles (mkv, mp4), etc. + ''; + homepage = "https://github.com/phiresky/ripgrep-all"; + license = with licenses; [ agpl3Plus ]; + maintainers = with maintainers; [ fliegendewurst ]; + mainProgram = "rga"; + }; +}