NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.73k stars 13.16k forks source link

Package request: Wetty #185773

Open hacker1024 opened 1 year ago

hacker1024 commented 1 year ago

Project description Wetty (Web + TTY) provides terminal access from a browser.

It's a yarn package, and includes an official systemd service file. Packaging it seems (to my extremely untrained eyes) fairly trivial with mkYarnPackage (and a port of the service file for NixOS configuration).

Metadata

hacker1024 commented 1 year ago

Until this done, shellinabox can be resurrected like so. I strongly recommend putting this behind another layer of authentication, though, as it was last updated in 2019.

shellinabox.nix

{ lib, callPackage, fetchFromGitHub, fetchurl, openssl_1_1 }:

((callPackage (import (fetchFromGitHub {
  owner = "NixOS";
  repo = "nixpkgs";
  rev = "363ef08971726937cd6a63de0efef7f8ba657b18";
  sha256 = "sha256-QRKAn5yLMyohZKsK72Vkd6HQUh3t5tDpFyI/Y7T3ASg=";
}) { }).shellinabox.override) { openssl = openssl_1_1; }).overrideAttrs
({ patches, ... }: {
  patches = patches ++ [
    # OpenSSL 1.1
    (fetchurl {
      url =
        "https://github.com/shellinabox/shellinabox/commit/c32f3d365a0848eb6b3350ec521fcd4d1d098295.patch";
      hash = "sha256-Q8otJUip1YQJb0ZSF89BjSvrCh4PQe4R7Rb7mtm33tk=";
    })
  ];
})

configuration.nix

{
  nixpkgs.overlays = [
    (self: super: {
      shellinabox = super.callPackage ./shellinabox { };
    })
  ];
}