summaryrefslogtreecommitdiffstats
path: root/nix
diff options
context:
space:
mode:
authorRuixi-rebirth <ruixirebirth@gmail.com>2023-05-27 20:49:55 -0600
committerGitHub <noreply@github.com>2023-05-27 22:49:55 -0400
commit20d51cf17a5e93cc20373423efeca72fd7c100d5 (patch)
treedca1d1be6cc5a31192c8a8acccef974649e1acce /nix
parent493af3185092036cbbae81ae620b101f66cf4e9a (diff)
Add flake support (#297)
Add flake support
Diffstat (limited to 'nix')
-rw-r--r--nix/default.nix35
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";
+ };
+}