···2020 mkBot = n: c:
2121 format.generate "${n}.json" (c.settings // {
2222 SteamLogin = if c.username == "" then n else c.username;
2323+ Enabled = c.enabled;
2424+ } // lib.optionalAttrs (c.passwordFile != null) {
2325 SteamPassword = c.passwordFile;
2426 # sets the password format to file (https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Security#file)
2527 PasswordFormat = 4;
2626- Enabled = c.enabled;
2728 });
2829in
2930{
···127128 default = "";
128129 };
129130 passwordFile = lib.mkOption {
130130- type = lib.types.path;
131131- description = lib.mdDoc "Path to a file containing the password. The file must be readable by the `archisteamfarm` user/group.";
131131+ type = with lib.types; nullOr path;
132132+ default = null;
133133+ description = lib.mdDoc ''
134134+ Path to a file containing the password. The file must be readable by the `archisteamfarm` user/group.
135135+ Omit or set to null to provide the password a different way, such as through the web-ui.
136136+ '';
132137 };
133138 enabled = lib.mkOption {
134139 type = lib.types.bool;
···11#!/usr/bin/env nix-shell
22-#!nix-shell -I nixpkgs=../../../../ -i python3 -p "python3.withPackages (ps: with ps; [ nix-prefetch-github ])" -p "git"
22+#!nix-shell -I nixpkgs=./ -i python3 -p "python3.withPackages (ps: with ps; [ requests ])" -p git -p nix-prefetch-github
3344import json
55import os
66import subprocess
77import sys
88-from pathlib import Path
98from concurrent.futures import ThreadPoolExecutor
99+from pathlib import Path
1010+1111+import requests
10121113SCRIPT_PATH = Path(__file__).absolute().parent
1214HASHES_PATH = SCRIPT_PATH / "hashes.json"
1315GET_REPO_THREADS = int(os.environ.get("GET_REPO_THREADS", 8))
1616+# To add a new core, add it to the dictionary below. You need to set at least
1717+# `repo`, that is the repository name if the owner of the repository is
1818+# `libretro` itself, otherwise also set `owner`.
1919+# You may set `deep_clone`, `fetch_submodules` or `leave_dot_git` options to
2020+# `True` and they're similar to `fetchgit` options. Also if for some reason you
2121+# need to pin a specific revision, set `rev` to a commit.
2222+# To generate the hash file for your new core, you can run `update_cores.py
2323+# <core>`. The script needs to be run from the root of your `nixpkgs` clone.
2424+# Do not forget to add your core to `cores.nix` file with the proper overrides
2525+# so the core can be build.
1426CORES = {
1527 "2048": {"repo": "libretro-2048"},
1628 "atari800": {"repo": "libretro-atari800"},
···7385 "opera": {"repo": "opera-libretro"},
7486 "parallel-n64": {"repo": "parallel-n64"},
7587 # libretro/lrps2 is a hard-fork of pcsx2 with simplified code to target
7676- # only libretro, while libretro/pcsx2 is supposedly closer to upstream.
7777- # TODO: switch to libretro/pcsx2 since this is more up-to-date
8888+ # only libretro, while libretro/pcsx2 is supposedly closer to upstream but
8989+ # it is a WIP.
9090+ # TODO: switch to libretro/pcsx2 when upstream switches to it.
7891 "pcsx2": {"repo": "lrps2"},
7992 "pcsx_rearmed": {"repo": "pcsx_rearmed"},
8093 "picodrive": {"repo": "picodrive", "fetch_submodules": True},
···115128 print(*msg, file=sys.stderr)
116129117130131131+def get_rev_date_fetchFromGitHub(repo, owner, rev):
132132+ # https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#get-a-commit
133133+ url = f"https://api.github.com/repos/{owner}/{repo}/commits/{rev}"
134134+ headers = {
135135+ "Accept": "application/vnd.github+json",
136136+ "X-GitHub-Api-Version": "2022-11-28",
137137+ }
138138+ if token := os.environ.get("GITHUB_TOKEN"):
139139+ headers["Authorization"] = f"Bearer {token}"
140140+ r = requests.get(url, headers=headers)
141141+142142+ try:
143143+ j = r.json()
144144+ except requests.exceptions.JSONDecodeError:
145145+ return None
146146+147147+ date = j.get("commit", {}).get("committer", {}).get("date")
148148+ if date:
149149+ # Date format returned by API: 2023-01-30T06:29:13Z
150150+ return f"unstable-{date[:10]}"
151151+ else:
152152+ return None
153153+154154+118155def get_repo_hash_fetchFromGitHub(
119156 repo,
120157 owner="libretro",
···146183 text=True,
147184 )
148185 j = json.loads(result.stdout)
186186+ date = get_rev_date_fetchFromGitHub(repo, owner, j["rev"])
187187+ if date:
188188+ j["date"] = date
149189 # Remove False values
150190 return {k: v for k, v in j.items() if v}
151191
···11+{ lib
22+, stdenv
33+, fetchurl
44+}:
55+66+stdenv.mkDerivation (finalAttrs: {
77+ pname = "tecla";
88+ version = "1.6.3";
99+1010+ src = fetchurl {
1111+ url = "https://www.astro.caltech.edu/~mcs/tecla/libtecla-${finalAttrs.version}.tar.gz";
1212+ hash = "sha256-8nV8xVBAhZ/Pj1mgt7JuAYSiK+zkTtlWikU0pHjB7ho=";
1313+ };
1414+1515+ outputs = [ "out" "man" ];
1616+1717+ postPatch = ''
1818+ substituteInPlace install-sh \
1919+ --replace "stripprog=" "stripprog=\$STRIP # "
2020+ '';
2121+2222+ env = lib.optionalAttrs stdenv.cc.isClang {
2323+ NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
2424+ };
2525+2626+ meta = {
2727+ homepage = "https://www.astro.caltech.edu/~mcs/tecla/";
2828+ description = "Command-line editing library";
2929+ longDescription = ''
3030+ The tecla library provides UNIX and LINUX programs with interactive
3131+ command line editing facilities, similar to those of the UNIX tcsh
3232+ shell. In addition to simple command-line editing, it supports recall of
3333+ previously entered command lines, TAB completion of file names or other
3434+ tokens, and in-line wild-card expansion of filenames. The internal
3535+ functions which perform file-name completion and wild-card expansion are
3636+ also available externally for optional use by programs.
3737+3838+ In addition, the library includes a path-searching module. This allows an
3939+ application to provide completion and lookup of files located in UNIX
4040+ style paths. Although not built into the line editor by default, it can
4141+ easily be called from custom tab-completion callback functions. This was
4242+ originally conceived for completing the names of executables and
4343+ providing a way to look up their locations in the user's PATH environment
4444+ variable, but it can easily be asked to look up and complete other types
4545+ of files in any list of directories.
4646+4747+ Note that special care has been taken to allow the use of this library in
4848+ threaded programs. The option to enable this is discussed in the
4949+ Makefile, and specific discussions of thread safety are presented in the
5050+ included man pages.
5151+ '';
5252+ changelog = "https://sites.astro.caltech.edu/~mcs/tecla/release.html";
5353+ license = with lib.licenses; [ mit ];
5454+ mainProgram = "enhance";
5555+ maintainers = with lib.maintainers; [ AndersonTorres ];
5656+ platforms = lib.platforms.unix;
5757+ };
5858+})
···55, lib
66, fetchFromGitHub
77, fetchurl
88+, copyDesktopItems
89, makeDesktopItem
910, python3
1011, libX11
···2122, libpulseaudio
2223, libpng
2324, imagemagick
2424-, requireFile
2525-2626-, oot ? rec {
2727- enable = true;
2828- variant = "debug";
2929-3030- rom = requireFile {
3131- name = "oot-${variant}.z64";
3232- message = ''
3333- This nix expression requires that oot-${variant}.z64 is already part of the store.
3434- To get this file you can dump your Ocarina of Time's cartridge to a file,
3535- and add it to the nix store with nix-store --add-fixed sha1 <FILE>, or override the package:
3636- shipwright.override { oot = { enable = true; variant = "debug"; rom = path/to/oot-debug-mq.z64; } }
3737-3838- The supported variants are:
3939- - debug: Ocarina of Time Debug PAL GC (not Master Quest)
4040- - pal-gc: Ocarina of Time PAL GameCube (may lead to crashes and instability)
4141-4242- This is optional if you have imported an Ocarina of Time Master Quest ROM.
4343- If so, please set oot.enable to false and ootMq.enable to true.
4444- If both are enabled, Ship of Harkinian will be built with both ROMs.
4545- '';
4646-4747- # From upstream: https://github.com/HarbourMasters/Shipwright/blob/e46c60a7a1396374e23f7a1f7122ddf9efcadff7/README.md#1-check-your-sha1
4848- sha1 = {
4949- debug = "cee6bc3c2a634b41728f2af8da54d9bf8cc14099";
5050- pal-gc = "0227d7c0074f2d0ac935631990da8ec5914597b4";
5151- }.${variant} or (throw "Unsupported romVariant ${variant}. Valid options are 'debug' and 'pal-gc'.");
5252- };
5353- }
5454-5555-, ootMq ? rec {
5656- enable = false;
5757- variant = "debug-mq";
5858-5959- rom = requireFile {
6060- name = "oot-${variant}.z64";
6161- message = ''
6262- This nix expression requires that oot-${variant}.z64 is already part of the store.
6363- To get this file you can dump your Ocarina of Time Master Quest's cartridge to a file,
6464- and add it to the nix store with nix-store --add-fixed sha1 <FILE>, or override the package:
6565- shipwright.override { ootMq = { enable = true; variant = "debug-mq"; rom = path/to/oot-debug-mq.z64; } }
6666-6767- The supported variants are:
6868- - debug-mq: Ocarina of Time Debug PAL GC MQ (Dungeons will be Master Quest)
6969- - debug-mq-alt: Alternate ROM, not produced by decompilation.
7070-7171- This is optional if you have imported an Ocarina of Time ROM.
7272- If so, please set oot.enable to true and ootMq.enable to false.
7373- If both are enabled, Ship of Harkinian will be built with both ROMs.
7474- '';
7575-7676- # From upstream: https://github.com/HarbourMasters/Shipwright/blob/e46c60a7a1396374e23f7a1f7122ddf9efcadff7/README.md#1-check-your-sha1
7777- sha1 = {
7878- debug-mq = "079b855b943d6ad8bd1eb026c0ed169ecbdac7da";
7979- debug-mq-alt = "50bebedad9e0f10746a52b07239e47fa6c284d03";
8080- }.${variant} or (throw "Unsupported mqRomVariant ${variant}. Valid options are 'debug-mq' and 'debug-mq-alt'.");
8181- };
8282- }
2525+, gnome
2626+, makeWrapper
8327}:
84288585-let
8686- checkAttrs = attrs:
8787- let
8888- validAttrs = [ "enable" "rom" "variant" ];
8989- in
9090- lib.all (name: lib.elem name validAttrs) (lib.attrNames attrs);
9191-in
9292-assert (lib.assertMsg (checkAttrs oot) "oot must have the attributes 'enable' and 'rom', and none other");
9393-assert (lib.assertMsg (checkAttrs ootMq) "ootMq must have the attributes 'enable' and 'rom', and none other");
9494-assert (lib.assertMsg (oot.enable || ootMq.enable) "At least one of 'oot.enable' and 'ootMq.enable' must be true");
9595-9696-stdenv.mkDerivation rec {
2929+stdenv.mkDerivation (finalAttrs: {
9730 pname = "shipwright";
9898- version = "7.1.1";
3131+ version = "8.0.4";
993210033 src = fetchFromGitHub {
10134 owner = "harbourmasters";
10235 repo = "shipwright";
103103- rev = version;
104104- hash = "sha256-zgxJj65wKsQWvVxeCspyHG9YqoYqZxd6GrYptOA8Byk=";
3636+ rev = finalAttrs.version;
3737+ hash = "sha256-OoDToHCVNzccbKdsmek1kqCsW2HmVzA2vy3BtVW1DuM=";
10538 fetchSubmodules = true;
10639 };
10740···10942 # https://github.com/HarbourMasters/Shipwright/blob/e46c60a7a1396374e23f7a1f7122ddf9efcadff7/soh/CMakeLists.txt#L736
11043 gamecontrollerdb = fetchurl {
11144 name = "gamecontrollerdb.txt";
112112- url = "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/c5b4df0e1061175cb11e3ebbf8045178339864a5/gamecontrollerdb.txt";
113113- hash = "sha256-2VFCsaalXoe+JYWCH6IbgjnLXNKxe0UqSyJNGZMn5Ko=";
4545+ url = "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/81d89fd1e2bd5878e57dfa629abeed3a8feea438/gamecontrollerdb.txt";
4646+ hash = "sha256-m1XzDc2dS0hkBTEGABgW4J/jjIw1TXtvHHtsvui6Bcc=";
11447 };
1154811649 nativeBuildInputs = [
···12053 lsb-release
12154 python3
12255 imagemagick
5656+ copyDesktopItems
5757+ makeWrapper
12358 ];
1245912560 buildInputs = [
···13570 SDL2_net
13671 libpulseaudio
13772 libpng
7373+ gnome.zenity
13874 ];
1397514076 cmakeFlags = [
14177 "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib"
7878+ (lib.cmakeBool "NON_PORTABLE" true)
14279 ];
1438014481 dontAddPrefix = true;
···14784 hardeningDisable = [ "format" ];
1488514986 postBuild = ''
150150- cp ${gamecontrollerdb} ${gamecontrollerdb.name}
151151-8787+ cp ${finalAttrs.gamecontrollerdb} ${finalAttrs.gamecontrollerdb.name}
15288 pushd ../OTRExporter
153153- ${lib.optionalString oot.enable "python3 ./extract_assets.py -z ../build/ZAPD/ZAPD.out ${oot.rom}"}
154154- ${lib.optionalString ootMq.enable "python3 ./extract_assets.py -z ../build/ZAPD/ZAPD.out ${ootMq.rom}"}
8989+ python3 ./extract_assets.py -z ../build/ZAPD/ZAPD.out --norom --xml-root ../soh/assets/xml --custom-assets-path ../soh/assets/custom --custom-otr-file soh.otr --port-ver ${finalAttrs.version}
15590 popd
15691 '';
15792···1629716398 postInstall = ''
16499 mkdir -p $out/bin
165165-166166- # Copy the extracted assets, required to be in the same directory as the executable
167167- ${lib.optionalString oot.enable "cp ../OTRExporter/oot.otr $out/lib"}
168168- ${lib.optionalString ootMq.enable "cp ../OTRExporter/oot-mq.otr $out/lib"}
169169-170100 ln -s $out/lib/soh.elf $out/bin/soh
101101+ install -Dm644 ../soh/macosx/sohIcon.png $out/share/pixmaps/soh.png
102102+ '';
103103+104104+ fixupPhase = ''
105105+ wrapProgram $out/lib/soh.elf --prefix PATH ":" ${lib.makeBinPath [ gnome.zenity ]}
171106 '';
172107173108 desktopItems = [
···175110 name = "soh";
176111 icon = "soh";
177112 exec = "soh";
113113+ comment = finalAttrs.meta.description;
178114 genericName = "Ship of Harkinian";
179115 desktopName = "soh";
180116 categories = [ "Game" ];
181117 })
182118 ];
183119184184- meta = with lib; {
120120+ meta = {
185121 homepage = "https://github.com/HarbourMasters/Shipwright";
186122 description = "A PC port of Ocarina of Time with modern controls, widescreen, high-resolution, and more";
187187- longDescription = ''
188188- An PC port of Ocarina of Time with modern controls, widescreen, high-resolution and more, based off of decompilation.
189189- Note that you must supply an OoT rom yourself to use this package because propietary assets are extracted from it.
190190-191191- You can change the game variant like this:
192192- shipwright.override { oot.enable = false; ootMq.enable = true }
193193-194194- The default ROM variants for Oot and OotMq are debug and debug-mq respectively.
195195- If you have a pal-gc rom, you should override like this:
196196- shipwright.override { oot = { enable = true; variant = "pal-gc"; rom = path/to/oot-pal-gc.z64; } }
197197-198198- The supported Oot variants are:
199199- - debug: Ocarina of Time Debug PAL GC (not Master Quest)
200200- - pal-gc: Ocarina of Time PAL GameCube (may lead to crashes and instability)
201201-202202- The supported OotMq variants are:
203203- - debug-mq: Ocarina of Time Debug PAL GC MQ (Dungeons will be Master Quest)
204204- - debug-mq-alt: Alternate ROM, not produced by decompilation.
205205- '';
206123 mainProgram = "soh";
207124 platforms = [ "x86_64-linux" ];
208208- maintainers = with maintainers; [ ivar j0lol ];
209209- license = with licenses; [
125125+ maintainers = with lib.maintainers; [ ivar j0lol ];
126126+ license = with lib.licenses; [
210127 # OTRExporter, OTRGui, ZAPDTR, libultraship
211128 mit
212129 # Ship of Harkinian itself
213130 unfree
214131 ];
215132 };
216216-}
133133+})
···705705 ### N ###
706706707707 ncdu_2 = ncdu; # Added 2022-07-22
708708-708708+ nestopia = throw "nestopia was forked; use nestopia-ue instead"; # Added 2024-01-24
709709 net_snmp = throw "'net_snmp' has been renamed to/replaced by 'net-snmp'"; # Converted to throw 2023-09-10
710710 netbox_3_3 = throw "netbox 3.3 series has been removed as it was EOL"; # Added 2023-09-02
711711 netbox_3_5 = throw "netbox 3.5 series has been removed as it was EOL"; # Added 2024-01-22