Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the doc #5

Open
zimbatm opened this issue Apr 29, 2021 · 2 comments
Open

Improve the doc #5

zimbatm opened this issue Apr 29, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zimbatm
Copy link
Member

zimbatm commented Apr 29, 2021

The doc could be better.

What is the best notation to describe nix functions?

Are all the use-cases covered in the readme?

@zimbatm zimbatm added enhancement New feature or request help wanted Extra attention is needed labels Apr 29, 2021
@kai-tub
Copy link
Contributor

kai-tub commented Apr 6, 2023

Before I create a separate issue, I would like to piggy-back on this issue:

Are all the use-cases covered in the readme?

I was about to create another issue because the readme does not state anything about flake/flake support.
As a nix-n00b, I first assumed that it doesn't support flakes and wasn't sure how to include it in my flake-based project.
Only after looking at the project for the second time, I saw that it does include flake.nix.
So I would like to extend the Usage section as:

Flake support

Or alternatively, if you are using it as a flake, this is how you could use it in your flake.nix file:

{
  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 = import nix-filter;
     # ....
    
    in
    {
      # ...
    };
}

PS: Happy to make this as a real PR

@zimbatm
Copy link
Member Author

zimbatm commented Apr 7, 2023

Sounds good!

The flake usage is like this:

{
  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
    {
      # ...
    };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants