From e396c06c4c2b9f8d47162dcd20155ec09163cb3b Mon Sep 17 00:00:00 2001 From: Linnnus Date: Sat, 16 Nov 2024 11:55:22 +0100 Subject: muhammed: Add cscript --- hosts/muhammed/home/dev-utils/default.nix | 1 + pkgs/cscript/default.nix | 30 ++++++++++++++++++++++++++++++ pkgs/default.nix | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 pkgs/cscript/default.nix diff --git a/hosts/muhammed/home/dev-utils/default.nix b/hosts/muhammed/home/dev-utils/default.nix index 18cc534..26bb40d 100644 --- a/hosts/muhammed/home/dev-utils/default.nix +++ b/hosts/muhammed/home/dev-utils/default.nix @@ -30,6 +30,7 @@ guile vemf unstable.gleam + cscript erlang_nox # Required by Gleam rebar3 # Required by Gleam unstable.nodejs_latest diff --git a/pkgs/cscript/default.nix b/pkgs/cscript/default.nix new file mode 100644 index 0000000..8c6faae --- /dev/null +++ b/pkgs/cscript/default.nix @@ -0,0 +1,30 @@ +{ + stdenv, + lib, + fetchFromGitHub, +}: +stdenv.mkDerivation rec { + pname = "cscript"; + version = "16-11-2024"; # Date of latest commit. + + src = fetchFromGitHub { + owner = "linnnus"; + repo = pname; + rev = "855f35a4e6d5046000a1d9ff7b887ccd7c4a8c91"; + hash = "sha256-d722f3K3QXnPqDVNVGBK+mj6Bl1VNShmJ4WICj0p64s="; + }; + + preInstall = "mkdir -p $out/bin"; + makeFlags = ["INSTALL=$(out)/bin"]; + + meta = with lib; { + description = "My take on the native shebang programming task from Rosetta Code"; + longDescription = '' + This package contains a C "interpreter". Behind the scenes it actually + compiles the file and runs it immediately, so it's not really an + interpreter. Point is, it allows you to use a shebang (just like + `#!/bin/sh`) to write C programs that execute like a Bash scripts. + ''; + license = licenses.unlicense; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index c8b08a7..6419d47 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -21,6 +21,8 @@ pkgs: { vemf = pkgs.callPackage ./vemf {}; + cscript = pkgs.callPackage ./cscript {}; + # TODO: These should be contained in the 'vimPlugins' attrset. This turns out # to be non-trivial because this module is both consumed in a flake output # context and an overlay context. -- cgit v1.2.3