From 016a6bc276a60e759dfdf9f6e7b1c2a92732efdf Mon Sep 17 00:00:00 2001 From: Piero Mantovani La Terza Date: Thu, 8 Jan 2026 13:34:09 -0300 Subject: [PATCH] oils-for-unix: expose both available shells oils-for-unix offers two shells, that share the same interpreter and runtime (`oils-for-unix`): - `osh` shell is compatible with interpreting runs POSIX shell, and `bash`. - `ysh` is a new shell language, incompatible with the existing bourne-shell dialects. With this change, the package exposes both options for users to choose from! --- pkgs/by-name/oi/oils-for-unix/package.nix | 32 ++++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/oi/oils-for-unix/package.nix b/pkgs/by-name/oi/oils-for-unix/package.nix index a32c5d9f5ddf..b60241dd8347 100644 --- a/pkgs/by-name/oi/oils-for-unix/package.nix +++ b/pkgs/by-name/oi/oils-for-unix/package.nix @@ -16,12 +16,12 @@ let ]; }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "oils-for-unix"; version = "0.37.0"; src = fetchurl { - url = "https://oils.pub/download/oils-for-unix-${version}.tar.gz"; + url = "https://oils.pub/download/oils-for-unix-${finalAttrs.version}.tar.gz"; hash = "sha256-9NQdIKBSPbz71LojH4Lt8lsI1JZdZbxx/LVmZtZ0MAA="; }; @@ -66,6 +66,10 @@ stdenv.mkDerivation rec { meta = { description = "Unix shell with JSON-compatible structured data. It's our upgrade path from bash to a better language and runtime"; homepage = "https://www.oils.pub/"; + longDescription = '' + This package installs both `osh` and `ysh`. To use one as a login shell, + select one of `pkgs.oils-for-unix.osh`, `pkgs.oils-for-unix.ysh`. + ''; license = lib.licenses.asl20; @@ -74,10 +78,24 @@ stdenv.mkDerivation rec { mkg20001 melkor333 ]; - changelog = "https://www.oils.pub/release/${version}/changelog.html"; + changelog = "https://www.oils.pub/release/${finalAttrs.version}/changelog.html"; }; - passthru = { - shellPath = "/bin/osh"; - }; -} + passthru = + let + mkShell = + shellName: + symlinkJoin { + name = "oils-for-unix-${shellName}-${finalAttrs.version}"; + paths = [ finalAttrs.finalPackage ]; + passthru.shellPath = "/bin/${shellName}"; + meta = finalAttrs.meta // { + mainProgram = shellName; + }; + }; + in + { + osh = mkShell "osh"; + ysh = mkShell "ysh"; + }; +})