Skip to content

Commit

Permalink
Revert "Use cachix cache in nix-env install instructions"
Browse files Browse the repository at this point in the history
This reverts commit d0a89db.
  • Loading branch information
mlvzk committed Sep 13, 2020
1 parent a85ef59 commit 58d459f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,9 @@ manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --previ
### nix-env

```sh
sudo nix-env \
--option extra-substituters https://mlvzk.cachix.org/ \
--option trusted-public-keys 'mlvzk.cachix.org-1:OxRv8xos92A++mh82CsgVo8J6cHGSVCOBFx7a6nhbWo=' \
-i -f https://github.com/mlvzk/manix/archive/master.tar.gz
nix-env -i -f https://github.com/mlvzk/manix/archive/master.tar.gz
```

If you're a trusted user or you don't wanna use the cachix cache you can run it without sudo.

### Nix with flakes enabled

``` sh
Expand Down
41 changes: 22 additions & 19 deletions src/bin/manix.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use anyhow::{Context, Result};
use colored::*;
use comments_docsource::CommentsDatabase;
use manix::*;
use options_docsource::{OptionsDatabase, OptionsDatabaseType};
Expand Down Expand Up @@ -197,26 +196,30 @@ fn main() -> Result<()> {
}
});

if !key_only_entries.is_empty() {
const SHOW_MAX_LEN: usize = 50;
print!("{}", "Here's what I found in nixpkgs:".bold());
for entry in key_only_entries.iter().take(SHOW_MAX_LEN) {
print!(" {}", entry.name().white());
}
if key_only_entries.len() > SHOW_MAX_LEN {
print!(" and {} more.", key_only_entries.len() - SHOW_MAX_LEN);
{
use colored::*;

if !key_only_entries.is_empty() {
const SHOW_MAX_LEN: usize = 50;
print!("{}", "Here's what I found in nixpkgs:".bold());
for entry in key_only_entries.iter().take(SHOW_MAX_LEN) {
print!(" {}", entry.name().white());
}
if key_only_entries.len() > SHOW_MAX_LEN {
print!(" and {} more.", key_only_entries.len() - SHOW_MAX_LEN);
}
println!("\n");
}
println!("\n");
}

for entry in entries {
const LINE: &str = "────────────────────";
println!(
"{}\n{}\n{}",
entry.source().white(),
LINE.green(),
entry.pretty_printed()
);
for entry in entries {
const LINE: &str = "────────────────────";
println!(
"{}\n{}\n{}",
entry.source().white(),
LINE.green(),
entry.pretty_printed()
);
}
}

Ok(())
Expand Down

0 comments on commit 58d459f

Please sign in to comment.