From 4d58cae50db95c0f5a316cfe64a17f4bd06102cb Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 26 Feb 2026 09:11:43 +0300 Subject: [PATCH] nix: add platforms to meta; allow overriding symlink behaviour Signed-off-by: NotAShelf Change-Id: Ib6e44abd86bd0e58f290b456680a97236a6a6964 --- nix/package.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nix/package.nix b/nix/package.nix index 336926a..b068d4a 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -4,9 +4,10 @@ stdenv, mold, versionCheckHook, + createSymlinks ? true, }: let pname = "stash"; - version = (builtins.fromTOML (builtins.readFile ../Cargo.toml)).package.version; + version = (lib.importTOML ../Cargo.toml).package.version; src = let fs = lib.fileset; s = ../.; @@ -36,7 +37,7 @@ in # generated by the build wrapper are correctly linked, we should link # them *manually*. The postInstallCheck phase that follows will check # to verify if all of those links are in place. - postInstall = '' + postInstall = lib.optionalString createSymlinks '' mkdir -p $out for bin in stash-copy stash-paste wl-copy wl-paste; do ln -sf $out/bin/stash $out/bin/$bin @@ -48,7 +49,7 @@ in # After the version check, let's see if all binaries are linked correctly. # We could probably add a check phase to get the versions of each. - postInstallCheck = '' + postInstallCheck = lib.optionalString createSymlinks '' for bin in stash stash-copy stash-paste wl-copy wl-paste; do [ -x "$out/bin/$bin" ] || { echo "$bin missing"; exit 1; } done @@ -65,5 +66,6 @@ in license = lib.licenses.mpl20; maintainers = [lib.maintainers.NotAShelf]; mainProgram = "stash"; + platforms = lib.platforms.linux; }; }