diff --git a/README.md b/README.md index 87d6a99..f1b6349 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,16 @@ The most convenient way is by running the following bash one-liner: curl -O https://raw.githubusercontent.com/18alantom/fex/master/install.sh && bash install.sh ``` +If you are a Nix user, just run one of the following commands: + +```bash +# Run the program immediately: +nix run github:18alantom/fex + +# Enter a temporary shell with `fex` available: +nix shell github:18alantom/fex +``` + Getting `fex` running involves: 1. Installing the `fex` executable. diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..55903d7 --- /dev/null +++ b/default.nix @@ -0,0 +1,19 @@ +{ + stdenv, + fetchFromGitHub, + zig, + ... +}: +stdenv.mkDerivation (finalAttrs: { + pname = "fex"; + version = "v0.1.1"; + + src = fetchFromGitHub { + owner = "18alantom"; + repo = finalAttrs.pname; + rev = finalAttrs.version; + hash = "sha256-9DY+q3ucJC13oSUdj2cp40P4IeFLxCOU03h/jgjmoaU="; + }; + + nativeBuildInputs = [ zig.hook ]; +}) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c54af88 --- /dev/null +++ b/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1722421184, + "narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1722555339, + "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ae51878 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "A command-line file explorer prioritizing quick navigation."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = + { nixpkgs, flake-parts, ... }@inputs: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ + "aarch64-darwin" + # "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + + perSystem = + { pkgs, ... }: + { + packages = rec { + default = fex; + fex = pkgs.callPackage ./. { }; + }; + }; + }; +}