diff options
author | Ruixi-rebirth <ruixirebirth@gmail.com> | 2023-05-27 20:49:55 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-27 22:49:55 -0400 |
commit | 20d51cf17a5e93cc20373423efeca72fd7c100d5 (patch) | |
tree | dca1d1be6cc5a31192c8a8acccef974649e1acce /nix | |
parent | 493af3185092036cbbae81ae620b101f66cf4e9a (diff) |
Add flake support (#297)
Add flake support
Diffstat (limited to 'nix')
-rw-r--r-- | nix/default.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000..60e1981 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,35 @@ +{ lib +, stdenv +, rustPlatform +, darwin +, version ? "git" +}: + +rustPlatform.buildRustPackage rec { + pname = "joshuto"; + inherit version; + + src = ../.; + + cargoLock = { + lockFile = ../Cargo.lock; + }; + + buildInputs = [ + ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.SystemConfiguration + darwin.apple_sdk.frameworks.Foundation + ]; + + patchPhase = '' + sed -i 's/env!("CARGO_PKG_VERSION")/\"${version}\"/g' src/main.rs + ''; + + meta = with lib;{ + description = "Ranger-like terminal file manager written in Rust"; + homepage = "https://github.com/kamiyaa/joshuto"; + license = licenses.lgpl3Only; + mainProgram = "joshuto"; + }; +} |