Skip to content

Commit

Permalink
doc(nix): document nix flakew
Browse files Browse the repository at this point in the history
Merge pull request #81 from cafkafk/cafkdev-flake-run-doc
  • Loading branch information
cafkafk authored Jul 29, 2023
2 parents c147bc0 + 096afe8 commit 2c917ff
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 25 deletions.
64 changes: 45 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,39 @@ By deliberately making some decisions differently, eza attempts to be a more fea
For more information, see [exa’s website](https://the.exa.website/).


---

<a id="try-it">
<h1>Try it!</h1>
</a>

### Nix ❄️

If you already have Nix setup with flake support, you can try out eza with the `nix run` command:

nix run github:cafkafk/eza

Nix will build eza and run it.

If you want to pass arguments this way, use e.g. `nix run github:cafkafk/eza -- -ol`.

<a id="installation">
<h1>Installation</h1>
</a>

eza is available for macOS and Linux.

### Cargo

If you already have a Rust environment set up, you can use the `cargo install` command:

cargo install eza

Cargo will build the `eza` binary and place it in `$HOME/.cargo`.

To build without Git support, run `cargo install --no-default-features eza` is also available, if the requisite dependencies are not installed.


---

<a id="options">
Expand Down Expand Up @@ -94,25 +127,6 @@ Some of the options accept parameters:
- Valid time styles are **default**, **iso**, **long-iso**, and **full-iso**.


---

<a id="installation">
<h1>Installation</h1>
</a>

eza is available for macOS and Linux.

### Cargo

If you already have a Rust environment set up, you can use the `cargo install` command:

cargo install eza

Cargo will build the `eza` binary and place it in `$HOME/.cargo`.

To build without Git support, run `cargo install --no-default-features eza` is also available, if the requisite dependencies are not installed.


---

<a id="development">
Expand Down Expand Up @@ -156,6 +170,18 @@ The full command is `cargo build --release --target=x86_64-unknown-linux-musl --

For more information, see the [Building from Source page](https://the.exa.website/install/source).

### Developing on Nix (experimental) ❄️

If you have a working Nix installation with flake support, you can use nix to manage your dev environment.

nix develop

The Nix Flake has a few features:
- Run `nix flake check` to run `treefmt` on the repo.
- Run `nix build` and manually test `./results/bin/eza -- <arguments>` for easy debugging.
- Run `nix build .#test` to run `cargo test` via the flake.
- Run `nix build .#clippy` to lint with clippy (still work in progress).


### Testing with Vagrant

Expand Down
2 changes: 1 addition & 1 deletion devtools/dev-create-test-filesystem.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script creates a bunch of awkward test case files. It gets
# automatically run as part of Vagrant provisioning.
trap 'exit' ERR
Expand Down
2 changes: 1 addition & 1 deletion devtools/dev-fixtures.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This file contains the text fixtures — the known, constant data — that are
# used when setting up the environment that exa’s tests get run in.

Expand Down
2 changes: 1 addition & 1 deletion devtools/dev-run-debug.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if [[ -f ~/target/debug/exa ]]; then
~/target/debug/exa "$@"
else
Expand Down
2 changes: 1 addition & 1 deletion devtools/dev-run-release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if [[ -f ~/target/release/exa ]]; then
~/target/release/exa "$@"
else
Expand Down
2 changes: 1 addition & 1 deletion devtools/dev-set-up-environment.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [[ ! -d "/vagrant" ]]; then
echo "This script should be run in the Vagrant environment"
Expand Down
2 changes: 1 addition & 1 deletion xtests/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
trap 'exit' ERR

# Check for release mode
Expand Down

0 comments on commit 2c917ff

Please sign in to comment.