commit
c560c27d5f
@ -0,0 +1,106 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
cfg = config.services.uptermd; |
||||
in |
||||
{ |
||||
options = { |
||||
services.uptermd = { |
||||
enable = mkEnableOption "uptermd"; |
||||
|
||||
openFirewall = mkOption { |
||||
type = types.bool; |
||||
default = false; |
||||
description = '' |
||||
Whether to open the firewall for the port in <option>services.uptermd.port</option>. |
||||
''; |
||||
}; |
||||
|
||||
port = mkOption { |
||||
type = types.port; |
||||
default = 2222; |
||||
description = '' |
||||
Port the server will listen on. |
||||
''; |
||||
}; |
||||
|
||||
listenAddress = mkOption { |
||||
type = types.str; |
||||
default = "[::]"; |
||||
example = "127.0.0.1"; |
||||
description = '' |
||||
Address the server will listen on. |
||||
''; |
||||
}; |
||||
|
||||
hostKey = mkOption { |
||||
type = types.nullOr types.path; |
||||
default = null; |
||||
example = "/run/keys/upterm_host_ed25519_key"; |
||||
description = '' |
||||
Path to SSH host key. If not defined, an ed25519 keypair is generated automatically. |
||||
''; |
||||
}; |
||||
|
||||
extraFlags = mkOption { |
||||
type = types.listOf types.str; |
||||
default = []; |
||||
example = [ "--debug" ]; |
||||
description = '' |
||||
Extra flags passed to the uptermd command. |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
networking.firewall = mkIf cfg.openFirewall { |
||||
allowedTCPPorts = [ cfg.port ]; |
||||
}; |
||||
|
||||
systemd.services.uptermd = { |
||||
description = "Upterm Daemon"; |
||||
wantedBy = [ "multi-user.target" ]; |
||||
after = [ "network.target" ]; |
||||
|
||||
path = [ pkgs.openssh ]; |
||||
|
||||
preStart = mkIf (cfg.hostKey == null) '' |
||||
if ! [ -f ssh_host_ed25519_key ]; then |
||||
ssh-keygen \ |
||||
-t ed25519 \ |
||||
-f ssh_host_ed25519_key \ |
||||
-N "" |
||||
fi |
||||
''; |
||||
|
||||
serviceConfig = { |
||||
StateDirectory = "uptermd"; |
||||
WorkingDirectory = "/var/lib/uptermd"; |
||||
ExecStart = "${pkgs.upterm}/bin/uptermd --ssh-addr ${cfg.listenAddress}:${toString cfg.port} --private-key ${if cfg.hostKey == null then "ssh_host_ed25519_key" else cfg.hostKey} ${concatStringsSep " " cfg.extraFlags}"; |
||||
|
||||
# Hardening |
||||
AmbientCapabilities = mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ]; |
||||
CapabilityBoundingSet = mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ]; |
||||
PrivateUsers = cfg.port >= 1024; |
||||
LockPersonality = true; |
||||
MemoryDenyWriteExecute = true; |
||||
PrivateDevices = true; |
||||
ProtectClock = true; |
||||
ProtectControlGroups = true; |
||||
ProtectHome = true; |
||||
ProtectHostname = true; |
||||
ProtectKernelLogs = true; |
||||
ProtectKernelModules = true; |
||||
ProtectKernelTunables = true; |
||||
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ]; |
||||
RestrictNamespaces = true; |
||||
RestrictRealtime = true; |
||||
SystemCallArchitectures = "native"; |
||||
SystemCallFilter = "@system-service"; |
||||
}; |
||||
}; |
||||
}; |
||||
} |
@ -0,0 +1,62 @@ |
||||
import ./make-test-python.nix ({ pkgs, ...}: |
||||
|
||||
let |
||||
client = {pkgs, ...}:{ |
||||
environment.systemPackages = [ pkgs.upterm ]; |
||||
}; |
||||
in |
||||
{ |
||||
name = "uptermd"; |
||||
meta = with pkgs.lib.maintainers; { |
||||
maintainers = [ fleaz ]; |
||||
}; |
||||
|
||||
nodes = { |
||||
server = {config, ...}: { |
||||
services.uptermd = { |
||||
enable = true; |
||||
openFirewall = true; |
||||
port = 1337; |
||||
}; |
||||
}; |
||||
client1 = client; |
||||
client2 = client; |
||||
}; |
||||
|
||||
|
||||
testScript = '' |
||||
start_all() |
||||
|
||||
server.wait_for_unit("uptermd.service") |
||||
server.wait_for_unit("network-online.target") |
||||
|
||||
# Add SSH hostkeys from the server to both clients |
||||
# uptermd needs an '@cert-authority entry so we need to modify the known_hosts file |
||||
client1.execute("sleep 3; mkdir -p ~/.ssh && ssh -o StrictHostKeyChecking=no -p 1337 server ls") |
||||
client1.execute("echo @cert-authority $(cat ~/.ssh/known_hosts) > ~/.ssh/known_hosts") |
||||
client2.execute("sleep 3; mkdir -p ~/.ssh && ssh -o StrictHostKeyChecking=no -p 1337 server ls") |
||||
client2.execute("echo @cert-authority $(cat ~/.ssh/known_hosts) > ~/.ssh/known_hosts") |
||||
|
||||
client1.wait_for_unit("multi-user.target") |
||||
client1.wait_until_succeeds("pgrep -f 'agetty.*tty1'") |
||||
client1.wait_until_tty_matches(1, "login: ") |
||||
client1.send_chars("root\n") |
||||
client1.wait_until_succeeds("pgrep -u root bash") |
||||
|
||||
client1.execute("ssh-keygen -t ed25519 -N \"\" -f /root/.ssh/id_ed25519") |
||||
client1.send_chars("TERM=xterm upterm host --server ssh://server:1337 --force-command hostname -- bash > /tmp/session-details\n") |
||||
client1.wait_for_file("/tmp/session-details") |
||||
client1.send_key("q") |
||||
|
||||
# uptermd can't connect if we don't have a keypair |
||||
client2.execute("ssh-keygen -t ed25519 -N \"\" -f /root/.ssh/id_ed25519") |
||||
|
||||
# Grep the ssh connect command from the output of 'upterm host' |
||||
ssh_command = client1.succeed("grep 'SSH Session' /tmp/session-details | cut -d':' -f2-").strip() |
||||
|
||||
# Connect with client2. Because we used '--force-command hostname' we should get "client1" as the output |
||||
output = client2.succeed(ssh_command) |
||||
|
||||
assert output.strip() == "client1" |
||||
''; |
||||
}) |
@ -1,44 +0,0 @@ |
||||
{ fetchFromGitHub, lib, stdenv, pkg-config, autoreconfHook |
||||
, openssl, db48, boost, zlib, miniupnpc |
||||
, qrencode, glib, protobuf, yasm, libevent |
||||
, util-linux |
||||
, enable_Upnp ? false |
||||
, disable_Wallet ? false |
||||
, disable_Daemon ? false }: |
||||
|
||||
with lib; |
||||
stdenv.mkDerivation rec { |
||||
pname = "dashpay"; |
||||
version = "0.12.2.3"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "dashpay"; |
||||
repo= "dash"; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-DMoiUX8Q0HcBHA6ZIN58uPsTnHjEJMi8eGG2DW8z17Q="; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ pkg-config autoreconfHook ]; |
||||
buildInputs = [ glib openssl db48 yasm boost zlib libevent |
||||
miniupnpc protobuf qrencode util-linux ]; |
||||
|
||||
|
||||
configureFlags = [ "--with-boost-libdir=${boost.out}/lib --with-gui=no" ] |
||||
++ optional enable_Upnp "--enable-upnp-default" |
||||
++ optional disable_Wallet "--disable-wallet" |
||||
++ optional disable_Daemon "--disable-daemon" |
||||
; |
||||
|
||||
meta = { |
||||
description = "A decentralized key/value registration and transfer system"; |
||||
longDescription = '' |
||||
Dash (DASH) is an open sourced, privacy-centric digital currency |
||||
with instant transactions. It allows you to keep your finances |
||||
private as you make transactions without waits, similar to cash. |
||||
''; |
||||
homepage = "https://www.dash.org"; |
||||
maintainers = with maintainers; [ ]; |
||||
platforms = platforms.unix; |
||||
license = licenses.mit; |
||||
}; |
||||
} |
@ -1,31 +0,0 @@ |
||||
{ trivialBuild, lib, fetchFromGitHub, curl }: |
||||
|
||||
trivialBuild { |
||||
pname = "plz"; |
||||
version = "0.pre+date=2021-08-22"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "alphapapa"; |
||||
repo = "plz.el"; |
||||
rev = "7e456638a651bab3a814e3ea81742dd917509cbb"; |
||||
hash = "sha256-8kn9ax1AVF6f9iCTqvVeJZihs03pYAhLjUDooG/ubxY="; |
||||
}; |
||||
|
||||
postPatch = '' |
||||
substituteInPlace ./plz.el \ |
||||
--replace 'plz-curl-program "curl"' 'plz-curl-program "${curl}/bin/curl"' |
||||
''; |
||||
|
||||
meta = { |
||||
description = "An HTTP library for Emacs"; |
||||
longDescription = '' |
||||
plz is an HTTP library for Emacs. It uses curl as a backend, which avoids |
||||
some of the issues with using Emacs’s built-in url library. It supports |
||||
both synchronous and asynchronous requests. Its API is intended to be |
||||
simple, natural, and expressive. Its code is intended to be simple and |
||||
well-organized. Every feature is tested against httpbin.org. |
||||
''; |
||||
license = lib.licenses.gpl3Only; |
||||
platforms = lib.platforms.all; |
||||
}; |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,21 @@ |
||||
# Setup hook for checking whether Python imports succeed |
||||
echo "Sourcing neovim-require-check-hook.sh" |
||||
|
||||
neovimRequireCheckHook () { |
||||
echo "Executing neovimRequireCheckHook" |
||||
|
||||
if [ -n "$nvimRequireCheck" ]; then |
||||
echo "Check whether the following module can be imported: $nvimRequireCheck" |
||||
|
||||
# editorconfig-checker-disable |
||||
export HOME="$TMPDIR" |
||||
@nvimBinary@ -es --headless -n -u NONE -i NONE --clean -V1 \ |
||||
--cmd "set rtp+=$out" \ |
||||
--cmd "lua require('$nvimRequireCheck')" |
||||
fi |
||||
} |
||||
|
||||
echo "Using neovimRequireCheckHook" |
||||
preDistPhases+=" neovimRequireCheckHook" |
||||
|
||||
|
@ -1,19 +1,19 @@ |
||||
{ |
||||
"name": "rust-analyzer", |
||||
"version": "0.2.975", |
||||
"version": "0.2.1048", |
||||
"dependencies": { |
||||
"vscode-languageclient": "8.0.0-next.8", |
||||
"vscode-languageclient": "8.0.0-next.14", |
||||
"d3": "^7.3.0", |
||||
"d3-graphviz": "^4.0.0", |
||||
"d3-graphviz": "^4.1.0", |
||||
"@types/node": "~14.17.5", |
||||
"@types/vscode": "~1.63.0", |
||||
"@typescript-eslint/eslint-plugin": "^5.10.0", |
||||
"@typescript-eslint/parser": "^5.10.0", |
||||
"@vscode/test-electron": "^2.1.1", |
||||
"eslint": "^8.7.0", |
||||
"@types/vscode": "~1.66.0", |
||||
"@typescript-eslint/eslint-plugin": "^5.16.0", |
||||
"@typescript-eslint/parser": "^5.16.0", |
||||
"@vscode/test-electron": "^2.1.3", |
||||
"eslint": "^8.11.0", |
||||
"tslib": "^2.3.0", |
||||
"typescript": "^4.5.5", |
||||
"typescript": "^4.6.3", |
||||
"typescript-formatter": "^7.2.2", |
||||
"vsce": "^2.6.7" |
||||
"vsce": "^2.7.0" |
||||
} |
||||
} |
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@ |
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 276ae4e..5e56176 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1304,9 +1304,9 @@ if (LINALG STREQUAL "MKL")
|
||||
endif ()
|
||||
else ()
|
||||
if (ADDRMODE EQUAL 64)
|
||||
- set (libpath "${MKLROOT}/lib/intel64")
|
||||
+ set (libpath "${MKLROOT}/lib")
|
||||
elseif (ADDRMODE EQUAL 32)
|
||||
- set (libpath "${MKLROOT}/lib/ia32")
|
||||
+ set (libpath "${MKLROOT}/lib")
|
||||
endif ()
|
||||
endif ()
|
||||
set (MKL_LIBRARY_PATH ${libpath} CACHE PATH "location of MKL libraries." FORCE)
|
||||
@@ -1380,7 +1380,7 @@ if (LINALG STREQUAL "MKL")
|
||||
find_library (LIBMKL_BLACS NAMES "mkl_blacs_intelmpi_ilp64"
|
||||
PATHS ${MKL_LIBRARY_PATH} NO_DEFAULT_PATH)
|
||||
elseif (MPI_IMPLEMENTATION STREQUAL "mpich")
|
||||
- find_library (LIBMKL_BLACS NAMES "mkl_blacs_ilp64"
|
||||
+ find_library (LIBMKL_BLACS NAMES "mkl_blacs_intelmpi_ilp64"
|
||||
PATHS ${MKL_LIBRARY_PATH} NO_DEFAULT_PATH)
|
||||
endif ()
|
@ -0,0 +1,192 @@ |
||||
{ addOpenGLRunpath |
||||
, autoPatchelfHook |
||||
, lib |
||||
, makeWrapper |
||||
, requireFile |
||||
, runCommand |
||||
, stdenv |
||||
, symlinkJoin |
||||
# arguments from default.nix |
||||
, lang |
||||
, meta |
||||
, name |
||||
, src |
||||
, version |
||||
# dependencies |
||||
, alsa-lib |
||||
, cudaPackages |
||||
, cups |
||||
, dbus |
||||
, flite |
||||
, fontconfig |
||||
, freetype |
||||
, gcc-unwrapped |
||||
, glib |
||||
, gmpxx |
||||
, keyutils |
||||
, libGL |
||||
, libGLU |
||||
, libpcap |
||||
, libtins |
||||
, libuuid |
||||
, libxkbcommon |
||||
, libxml2 |
||||
, llvmPackages_12 |
||||
, matio |
||||
, mpfr |
||||
, ncurses |
||||
, opencv4 |
||||
, openjdk11 |
||||
, openssl |
||||
, pciutils |
||||
, tre |
||||
, unixODBC |
||||
, xkeyboard_config |
||||
, xorg |
||||
, zlib |
||||
# options |
||||
, cudaSupport |
||||
}: |
||||
|
||||
let cudaEnv = symlinkJoin { |
||||
name = "mathematica-cuda-env"; |
||||
paths = with cudaPackages; [ |
||||
cuda_cudart cuda_nvcc libcublas libcufft libcurand libcusparse |
||||
]; |
||||
postBuild = '' |
||||
ln -s ${addOpenGLRunpath.driverLink}/lib/libcuda.so $out/lib |
||||
ln -s lib $out/lib64 |
||||
''; |
||||
}; |
||||
|
||||
in stdenv.mkDerivation { |
||||
inherit meta name src version; |
||||
|
||||
nativeBuildInputs = [ |
||||
autoPatchelfHook |
||||
makeWrapper |
||||
] ++ lib.optional cudaSupport addOpenGLRunpath; |
||||
|
||||
buildInputs = [ |
||||
alsa-lib |
||||
cups.lib |
||||
dbus |
||||
flite |
||||
fontconfig |
||||
freetype |
||||
glib |
||||
gmpxx |
||||
keyutils.lib |
||||
libGL |
||||
libGLU |
||||
libpcap |
||||
libtins |
||||
libuuid |
||||
libxkbcommon |
||||
libxml2 |
||||
llvmPackages_12.libllvm.lib |
||||
matio |
||||
mpfr |
||||
ncurses |
||||
opencv4 |
||||
openjdk11 |
||||
openssl |
||||
pciutils |
||||
tre |
||||
unixODBC |
||||
xkeyboard_config |
||||
] ++ (with xorg; [ |
||||
libICE |
||||
libSM |
||||
libX11 |
||||
libXScrnSaver |
||||
libXcomposite |
||||
libXcursor |
||||
libXdamage |
||||
libXext |
||||
libXfixes |
||||
libXi |
||||
libXinerama |
||||
libXmu |
||||
libXrandr |
||||
libXrender |
||||
libXtst |
||||
libxcb |
||||
]) ++ lib.optional cudaSupport cudaEnv; |
||||
|
||||
wrapProgramFlags = [ |
||||
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gcc-unwrapped.lib zlib ]}" |
||||
"--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}" |
||||
# Fix libQt errors - #96490 |
||||
"--set USE_WOLFRAM_LD_LIBRARY_PATH 1" |
||||
# Fix xkeyboard config path for Qt |
||||
"--set QT_XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb" |
||||
] ++ lib.optionals cudaSupport [ |
||||
"--set CUDA_PATH ${cudaEnv}" |
||||
"--set NVIDIA_DRIVER_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib/libnvidia-tls.so" |
||||
"--set CUDA_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib/libcuda.so" |
||||
]; |
||||
|
||||
unpackPhase = '' |
||||
runHook preUnpack |
||||
|
||||
# Find offset from file |
||||
offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src) |
||||
tail -c +$(($offset + 1)) $src | tar -xf - |
||||
|
||||
runHook postUnpack |
||||
''; |
||||
|
||||
installPhase = '' |
||||
runHook preInstall |
||||
|
||||
cd "$TMPDIR/Unix/Installer" |
||||
|
||||
mkdir -p "$out/lib/udev/rules.d" |
||||
|
||||
# Patch MathInstaller's shebangs and udev rules dir |
||||
patchShebangs MathInstaller |
||||
substituteInPlace MathInstaller \ |
||||
--replace /etc/udev/rules.d $out/lib/udev/rules.d |
||||
|
||||
# Remove PATH restriction, root and avahi daemon checks, and hostname call |
||||
sed -i ' |
||||
s/^PATH=/# &/ |
||||
s/isRoot="false"/# &/ |
||||
s/^checkAvahiDaemon$/# &/ |
||||
s/`hostname`/""/ |
||||
' MathInstaller |
||||
|
||||
# NOTE: some files placed under HOME may be useful |
||||
XDG_DATA_HOME="$out/share" HOME="$TMPDIR/home" vernierLink=y \ |
||||
./MathInstaller -execdir="$out/bin" -targetdir="$out/libexec/Mathematica" -auto -verbose -createdir=y |
||||
|
||||
# Check if MathInstaller produced any errors |
||||
errLog="$out/libexec/Mathematica/InstallErrors" |
||||
if [ -f "$errLog" ]; then |
||||
echo "Installation errors:" |
||||
cat "$errLog" |
||||
return 1 |
||||
fi |
||||
|
||||
runHook postInstall |
||||
''; |
||||
|
||||
preFixup = '' |
||||
for bin in $out/libexec/Mathematica/Executables/*; do |
||||
wrapProgram "$bin" ''${wrapProgramFlags[@]} |
||||
done |
||||
''; |
||||
|
||||
dontConfigure = true; |
||||
dontBuild = true; |
||||
|
||||
# This is primarily an IO bound build; there's little benefit to building remotely |
||||
preferLocalBuild = true; |
||||
|
||||
# All binaries are already stripped |
||||
dontStrip = true; |
||||
|
||||
# NOTE: Some deps are still not found; ignore for now |
||||
autoPatchelfIgnoreMissingDeps = true; |
||||
} |
@ -1,106 +0,0 @@ |
||||
{ lib |
||||
, requireFile |
||||
, lang |
||||
, majorVersion ? null |
||||
}: |
||||
|
||||
let allVersions = with lib; flip map |
||||
# N.B. Versions in this list should be ordered from newest to oldest. |
||||
[ |
||||
{ |
||||
version = "13.0.1"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "3672a920c1b4af1afd480733f6d67665baf8258757dfe59a6ed6d7440cf26dba"; |
||||
installer = "Mathematica_13.0.1_BNDL_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "13.0.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "15bbad39a5995031325d1d178f63b00e71706d3ec9001eba6d1681fbc991d3e1"; |
||||
installer = "Mathematica_13.0.0_BNDL_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.3.1"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "51b9cab12fd91b009ea7ad4968a2c8a59e94dc55d2e6cc1d712acd5ba2c4d509"; |
||||
installer = "Mathematica_12.3.1_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.3.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "045df045f6e796ded59f64eb2e0f1949ac88dcba1d5b6e05fb53ea0a4aed7215"; |
||||
installer = "Mathematica_12.3.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.2.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "3b6676a203c6adb7e9c418a5484b037974287b5be09c64e7dfea74ddc0e400d7"; |
||||
installer = "Mathematica_12.2.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.1.1"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "02mk8gmv8idnakva1nc7r7mx8ld02lk7jgsj1zbn962aps3bhixd"; |
||||
installer = "Mathematica_12.1.1_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.1.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "15m9l20jvkxh5w6mbp81ys7mx2lx5j8acw5gz0il89lklclgb8z7"; |
||||
installer = "Mathematica_12.1.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.0.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "b9fb71e1afcc1d72c200196ffa434512d208fa2920e207878433f504e58ae9d7"; |
||||
installer = "Mathematica_12.0.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "11.3.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "0fcfe208c1eac8448e7be3af0bdb84370b17bd9c5d066c013928c8ee95aed10e"; |
||||
installer = "Mathematica_11.3.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "11.2.0"; |
||||
lang = "ja"; |
||||
language = "Japanese"; |
||||
sha256 = "916392edd32bed8622238df435dd8e86426bb043038a3336f30df10d819b49b1"; |
||||
installer = "Mathematica_11.2.0_ja_LINUX.sh"; |
||||
} |
||||
] |
||||
({ version, lang, language, sha256, installer }: { |
||||
inherit version lang; |
||||
name = "mathematica-${version}" + optionalString (lang != "en") "-${lang}"; |
||||
src = requireFile { |
||||
name = installer; |
||||
message = '' |
||||
This nix expression requires that ${installer} is |
||||
already part of the store. Find the file on your Mathematica CD |
||||
and add it to the nix store with nix-store --add-fixed sha256 <FILE>. |
||||
''; |
||||
inherit sha256; |
||||
}; |
||||
}); |
||||
minVersion = |
||||
with lib; |
||||
if majorVersion == null |
||||
then elemAt (builtins.splitVersion (elemAt allVersions 0).version) 0 |
||||
else majorVersion; |
||||
maxVersion = toString (1 + builtins.fromJSON minVersion); |
||||
in |
||||
with lib; |
||||
findFirst (l: (l.lang == lang |
||||
&& l.version >= minVersion |
||||
&& l.version < maxVersion)) |
||||
(throw "Version ${minVersion} in language ${lang} not supported") |
||||
allVersions |
@ -0,0 +1,103 @@ |
||||
{ lib, requireFile }: |
||||
|
||||
let versions = [ |
||||
{ |
||||
version = "13.0.1"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-NnKpIMG0rxr9SAcz9tZ2Zbr4JYdX3+WabtbXRAzybbo="; |
||||
installer = "Mathematica_13.0.1_BNDL_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "13.0.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-FbutOaWZUDEyXR0Xj2OwDnFwbT7JAB66bRaB+8mR0+E="; |
||||
installer = "Mathematica_13.0.0_BNDL_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.3.1"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-UbnKsS/ZGwCep61JaKLIpZ6U3FXS5swdcSrNW6LE1Qk="; |
||||
installer = "Mathematica_12.3.1_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.3.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-BF3wRfbnlt7Vn2TrLg8ZSayI3LodW24F+1PqCkrtchU="; |
||||
installer = "Mathematica_12.3.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.2.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-O2Z2ogPGrbfpxBilSEsDeXQoe1vgnGTn3+p03cDkANc="; |
||||
installer = "Mathematica_12.2.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.1.1"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-rUe4hr5KmGTXD1I/eSYVoFHU68mH2aD2VLZFtOtDswo="; |
||||
installer = "Mathematica_12.1.1_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.1.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-56P1KKOTJkQj+K9wppAsnYpej/YB3VUNL7DPLYGgqZY="; |
||||
installer = "Mathematica_12.1.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "12.0.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-uftx4a/MHXLCABlv+kNFEtII+ikg4geHhDP1BOWK6dc="; |
||||
installer = "Mathematica_12.0.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "11.3.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-D8/iCMHqyESOe+OvC9uENwsXvZxdBmwBOSjI7pWu0Q4="; |
||||
installer = "Mathematica_11.3.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "11.2.0"; |
||||
lang = "ja"; |
||||
language = "Japanese"; |
||||
sha256 = "sha256-kWOS7dMr7YYiI430Nd2OhkJrsEMDijM28w3xDYGbSbE="; |
||||
installer = "Mathematica_11.2.0_ja_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "9.0.0"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-mKgxdd7dLWa5EOuR5C37SeU+UC9Cv5YTbY5xSK9y34A="; |
||||
installer = "Mathematica_9.0.0_LINUX.sh"; |
||||
} |
||||
{ |
||||
version = "10.0.2"; |
||||
lang = "en"; |
||||
language = "English"; |
||||
sha256 = "sha256-NHUg1jzLos1EsIr8TdYdNaA5+3jEcFqVZIr9GVVUXrQ="; |
||||
installer = "Mathematica_10.0.2_LINUX.sh"; |
||||
} |
||||
]; |
||||
|
||||
in |
||||
|
||||
lib.flip map versions ({ version, lang, language, sha256, installer }: { |
||||
inherit version lang; |
||||
src = requireFile { |
||||
name = installer; |
||||
message = '' |
||||
This nix expression requires that ${installer} is |
||||
already part of the store. Find the file on your Mathematica CD |
||||
and add it to the nix store with nix-store --add-fixed sha256 <FILE>. |
||||
''; |
||||
inherit sha256; |
||||
}; |
||||
}) |
@ -0,0 +1,16 @@ |
||||
{ runCommand }: |
||||
|
||||
firmware: |
||||
|
||||
runCommand "${firmware.name}-xz" {} '' |
||||
mkdir -p $out/lib |
||||
(cd ${firmware} && find lib/firmware -type d -print0) | |
||||
(cd $out && xargs -0 mkdir -v --) |
||||
(cd ${firmware} && find lib/firmware -type f -print0) | |
||||
(cd $out && xargs -0tP "$NIX_BUILD_CORES" -n1 \ |
||||
sh -c 'xz -9c -T1 -C crc32 --lzma2=dict=2MiB "${firmware}/$1" > "$1.xz"' --) |
||||
(cd ${firmware} && find lib/firmware -type l) | while read link; do |
||||
target="$(readlink "${firmware}/$link")" |
||||
ln -vs -- "''${target/^${firmware}/$out}.xz" "$out/$link.xz" |
||||
done |
||||
'' |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue