mirror of
https://github.com/numtide/nix-filter.git
synced 2024-09-11 14:16:38 +03:00
Merge pull request #37 from kai-tub/main
Add flake usage to README & skip CI on doc changes
This commit is contained in:
commit
f529f42792
4
.github/workflows/nix.yml
vendored
4
.github/workflows/nix.yml
vendored
@ -2,7 +2,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
build:
|
||||
|
21
README.md
21
README.md
@ -86,6 +86,27 @@ and `path` types to a matcher.
|
||||
The matcher is a function that takes a `path` and `type` and returns `true` if
|
||||
the pattern matches.
|
||||
|
||||
The flake usage is like this:
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
|
||||
nix-filter.url = "github:numtide/nix-filter";
|
||||
};
|
||||
outputs = { self, nixpkgs, nix-filter }:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
# Avoid calling it nix-filter as it may result in an infinite recursion
|
||||
filter = nix-filter.lib;
|
||||
# ....
|
||||
in
|
||||
{
|
||||
# ...
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Builtin matchers
|
||||
|
||||
The functor also contains a number of matchers:
|
||||
|
Loading…
Reference in New Issue
Block a user