Browse Source

doc(nix): document nix flakew

Merge pull request #81 from cafkafk/cafkdev-flake-run-doc
Christina Sørensen 2 years ago
parent
commit
2c917fff1b

+ 45 - 19
README.md

@@ -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/).
 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">
 <a id="options">
@@ -94,25 +127,6 @@ Some of the options accept parameters:
 - Valid time styles are **default**, **iso**, **long-iso**, and **full-iso**.
 - 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">
 <a id="development">
@@ -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).
 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
 ### Testing with Vagrant
 
 

+ 1 - 1
devtools/dev-create-test-filesystem.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # This script creates a bunch of awkward test case files. It gets
 # This script creates a bunch of awkward test case files. It gets
 # automatically run as part of Vagrant provisioning.
 # automatically run as part of Vagrant provisioning.
 trap 'exit' ERR
 trap 'exit' ERR

+ 1 - 1
devtools/dev-fixtures.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # This file contains the text fixtures — the known, constant data — that are
 # 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.
 # used when setting up the environment that exa’s tests get run in.
 
 

+ 1 - 1
devtools/dev-run-debug.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 if [[ -f ~/target/debug/exa ]]; then
 if [[ -f ~/target/debug/exa ]]; then
   ~/target/debug/exa "$@"
   ~/target/debug/exa "$@"
 else
 else

+ 1 - 1
devtools/dev-run-release.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 if [[ -f ~/target/release/exa ]]; then
 if [[ -f ~/target/release/exa ]]; then
   ~/target/release/exa "$@"
   ~/target/release/exa "$@"
 else
 else

+ 1 - 1
devtools/dev-set-up-environment.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 
 if [[ ! -d "/vagrant" ]]; then
 if [[ ! -d "/vagrant" ]]; then
     echo "This script should be run in the Vagrant environment"
     echo "This script should be run in the Vagrant environment"

+ 1 - 1
xtests/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 trap 'exit' ERR
 trap 'exit' ERR
 
 
 # Check for release mode
 # Check for release mode