Giter Club home page Giter Club logo

manix's People

Contributors

elkowar avatar mic92 avatar mlvzk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

manix's Issues

`manix list` leads to error

$ RUST_BACKTRACE=1 manix list
# listDfs (lib/lists.nix)
 Depth-First Search (DFS) for lists `list != []`.

     `before a b == true` means that `b` depends on `a` (there's an
     edge from `b` to `a`).

     Example:
         listDfs true hasPrefix [ "/home/user" "other" "/" "/home" ]
           == { minimal = "/";                  # minimal element
                visited = [ "/home/user" ];     # seen elements (in reverse order)
                rest    = [ "/home" "other" ];  # everything else
              }

         listDfs true hasPrefix [ "/home/user" "other" "/" "/home" "/" ]
           == { cycle   = "/";                  # cycle encountered at this element
                loops   = [ "/" ];              # and continues to these elements
                visited = [ "/" "/home/user" ]; # elements leading to the cycle (in reverse order)
                rest    = [ "/home" "other" ];  # everything else

   


thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: StripPrefixError(())', src/libcore/result.rs:1188:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: manix::comments_docsource::CommentDocumentation::pretty_printed
  10: manix::DocEntry::pretty_printed
  11: manix::main
  12: std::rt::lang_start::{{closure}}
  13: std::panicking::try::do_call
  14: __rust_maybe_catch_panic
  15: std::rt::lang_start_internal
  16: main
  17: __libc_start_main
  18: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Document builtin functions as well?

Was hoping to use this to look up functions while writing Nix code but it doesn't output anything:

$ manix lib.listToAttrs
Building Home Manager Options cache...
Building NixOS Options cache...
Building Nixpkgs Tree cache...
Building Nixpkgs Documentation cache...
Here's what I found in nixpkgs: lib.listToAttrs

Failed to load Home Manager Options cache file: Os { code: 2, kind: NotFound, message: "No such file or directory" }

I don't know if it's related but I'm using home-manager.users to use home-manager in my configuration.nix. And I'm using niv so I don't have any home-manager channel.

manix 1272c45

❯ manix notmuch                                                               nix-shell
Failed to load Home Manager Options cache file: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Here's what I found in nixpkgs: python39Packages.notmuch pkgsTargetTarget.notmuch-mutt pkgsTargetTarget.notmuch-addrlookup pkgsTargetTarget.notmuch-bower pkgsTargetTarget.notmuch python37Packages.notmuch buildPackages.notmuch-mutt buildPackages.notmuch buildPackages.notmuch-bower buildPackages.notmuch-addrlookup notmuch-mutt python3Packages.notmuch python38Packages.notmuch pkgsMusl.notmuch-bower pkgsMusl.notmuch-mutt pkgsMusl.notmuch-addrlookup pkgsMusl.notmuch pkgsBuildHost.notmuch-addrlookup pkgsBuildHost.notmuch pkgsBuildHost.notmuch-bower pkgsBuildHost.notmuch-mutt pkgsBuildTarget.notmuch-mutt pkgsBuildTarget.notmuch-addrlookup pkgsBuildTarget.notmuch pkgsBuildTarget.notmuch-bower python27Packages.notmuch vimPlugins.deoplete-notmuch __splicedPackages.notmuch-addrlookup __splicedPackages.notmuch __splicedPackages.notmuch-mutt __splicedPackages.notmuch-bower emacs27Packages.counsel-notmuch emacs27Packages.notmuch-bookmarks emacs27Packages.helm-notmuch emacs27Packages.notmuch emacs27Packages.notmuch-labeler pkgsStatic.notmuch-addrlookup pkgsStatic.notmuch-mutt pkgsStatic.notmuch-bower pkgsStatic.notmuch notmuch-addrlookup targetPackages.notmuch targetPackages.notmuch-addrlookup targetPackages.notmuch-mutt targetPackages.notmuch-bower pypyPackages.notmuch pkgsHostTarget.notmuch pkgsHostTarget.notmuch-bower pkgsHostTarget.notmuch-mutt pkgsHostTarget.notmuch-addrlookup and 38 more.
  • system: "x86_64-linux"
  • host os: Linux 5.7.10-zen1, NixOS, 20.09pre-git (Nightingale)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.7
  • channels(root): "nixos-20.09pre237686.96069f7d890"
  • nixpkgs: /run/current-system/nixpkgs

Manix Crashes on Cache building

Running manix straight from an install produces the following error:

Building Nixpkgs comments cache...
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/comments_docsource.rs:178:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Havent been able to get around this

Failed to load nixpkgs tree and documentation cache

Hey @mlvzk thanks for this awesome package.

I'm getting two errors in spite of getting results

Failed to load Nixpkgs Tree cache file: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Failed to load Nixpkgs Documentation cache file: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Nixpkgs Comments
────────────────────

Any clue what I'm doing wrong. Thanks

Failed to update NixOS Options

Building Nixpkgs comments cache...
Building Home Manager Options cache...
Building NixOS Options cache...
Failed to update NixOS Options

Caused by:
    0: Failed to perform IO on a cache file
    1: No such file or directory (os error 2)

manix 0.6.2
macOS

Index Home Manager options from the Flake Registry

I'm configuring Home-Manager from my system's configuration, defined in a
Flake.

I don't use channels and I'd like to avoid setting those, not to give them a
chance to go out of sync with the inputs of the Flake.

Nevertheless, I have Home Manager registered in the
nix.registry option.

I currently get this error when rebuilding the manix cache:

❯ manix --update-cache test
Building Home Manager Options cache...
Failed to update Home Manager Options

Caused by:
    0: Failed to perform IO on a cache file
    1: No such file or directory (os error 2)
Tip: If you installed your home-manager through configuration.nix you can fix this error by adding the home-manager channel with this command: nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager && nix-channel --update

Would it be feasible to index Home Manager options from the Flake registry
instead of a channel?

Consider improving highlighting

Hey, great project but I have a little suggestion - Implement some sort of type highlighting. This is my current temp workaround:

manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --ansi --preview="manix '{}' | sed 's/type: /> type: /g' | bat -l Markdown --color=always --plain" 

I am just adding the symbol > in front of the type. Seems to get the job done :)

Thanks for this project, and good luck 👍

Add generated options documentation as another doc source

The data that the generated JSON documentation from options can provide should be used as a documentation source.
This would imply:

  • adding an abstraction for different doc sources, some of which might not need any hashing or stuff like that
  • generating the options documentation for NixOS options as well as home-manager / finding where they are by default
  • Adding the documentation source.

No hm options

I'm getting the following error when updating the cache:

❯ manix "" -u --source hm_options
Building Home Manager Options cache...
Failed to update Home Manager Options

Caused by:
    0: Failed to perform IO on a cache file
    1: No such file or directory (os error 2)
Tip: If you installed your home-manager through configuration.nix you can fix this error by adding the home-manager channel with this command: nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager && nix-channel --update
Building NixOS Options cache...
Building Nixpkgs Tree cache...
Building Nixpkgs Documentation cache...

Here are my channels:

❯ nix-channel --list
home-manager https://github.com/rycee/home-manager/archive/master.tar.gz
nixos https://nixos.org/channels/nixos-unstable

I am using manix 0.6.3. Have I missed something?

Option to filter out results?

Hi, thanks for working on this, it's awesome!

I was wondering if it would be possible to add a --source option (or something like that) so it can only search in a specific source (e.g. only search Home Manager options)?

For example, if I search for programs.chromium, I currently get this result:

❯ manix -s programs.chromium  

HomeManager Options
────────────────────
# programs.chromium.package
The Chromium package to use.
type: package


HomeManager Options
────────────────────
# programs.chromium.extensions
List of Chromium extensions to install.
To find the extension ID, check its URL on the
<link xlink:href="https://chrome.google.com/webstore/category/extensions">Chrome Web Store</link>.

type: list of strings


HomeManager Options
────────────────────
# programs.chromium.enable
Whether to enable Chromium.
type: boolean


NixOS Options
────────────────────
# programs.chromium.enable
Whether to enable <command>chromium</command> policies.
type: boolean


NixOS Options
────────────────────
# programs.chromium.defaultSearchProviderSuggestURL
Chromium default search provider url for suggestions.
type: null or string


NixOS Options
────────────────────
# programs.chromium.homepageLocation
Chromium default homepage
type: null or string


NixOS Options
────────────────────
# programs.chromium.extensions
List of chromium extensions to install.
For list of plugins ids see id in url of extensions on
<link xlink:href="https://chrome.google.com/webstore/category/extensions">chrome web store</link>
page. To install a chromium extension not included in the chrome web
store, append to the extension id a semicolon ";" followed by a URL
pointing to an Update Manifest XML file. See
<link xlink:href="https://www.chromium.org/administrators/policy-list-3#ExtensionInstallForcelist">ExtensionInstallForcelist</link>
for additional details.

type: list of strings


NixOS Options
────────────────────
# programs.chromium.extraOpts
Extra chromium policy options. A list of available policies
can be found in the Chrome Enterprise documentation:
<link xlink:href="https://cloud.google.com/docs/chrome-enterprise/policies/">https://cloud.google.com/docs/chrome-enterprise/policies/</link>
Make sure the selected policy is supported on Linux and your browser version.

type: attribute set


NixOS Options
────────────────────
# programs.chromium.defaultSearchProviderSearchURL
Chromium default search provider url.
type: null or string

When I'm only interested in seeing Home Manager options. I could filter the results out using grep or ripgrep but I think it would be more efficient to only search in the sources I'm interested in.

What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.