···11{ lib, ... }:22rec {33 /*44- Compute the fixed point of the given function `f`, which is usually an55- attribute set that expects its final, non-recursive representation as an66- argument:44+ `fix f` computes the fixed point of the given function `f`. In other words, the return value is `x` in `x = f x`.7588- ```99- f = self: { foo = "foo"; bar = "bar"; foobar = self.foo + self.bar; }66+ `f` must be a lazy function.77+ This means that `x` must be a value that can be partially evaluated,88+ such as an attribute set, a list, or a function.99+ This way, `f` can use one part of `x` to compute another part.1010+1111+ **Relation to syntactic recursion**1212+1313+ This section explains `fix` by refactoring from syntactic recursion to a call of `fix` instead.1414+1515+ For context, Nix lets you define attributes in terms of other attributes syntactically using the [`rec { }` syntax](https://nixos.org/manual/nix/stable/language/constructs.html#recursive-sets).1616+1717+ ```nix1818+ nix-repl> rec {1919+ foo = "foo";2020+ bar = "bar";2121+ foobar = foo + bar;2222+ }2323+ { bar = "bar"; foo = "foo"; foobar = "foobar"; }1024 ```11251212- Nix evaluates this recursion until all references to `self` have been1313- resolved. At that point, the final result is returned and `f x = x` holds:2626+ This is convenient when constructing a value to pass to a function for example,2727+ but an equivalent effect can be achieved with the `let` binding syntax:14282929+ ```nix3030+ nix-repl> let self = {3131+ foo = "foo";3232+ bar = "bar";3333+ foobar = self.foo + self.bar;3434+ }; in self3535+ { bar = "bar"; foo = "foo"; foobar = "foobar"; }1536 ```3737+3838+ But in general you can get more reuse out of `let` bindings by refactoring them to a function.3939+4040+ ```nix4141+ nix-repl> f = self: {4242+ foo = "foo";4343+ bar = "bar";4444+ foobar = self.foo + self.bar;4545+ }4646+ ```4747+4848+ This is where `fix` comes in, it contains the syntactic that's not in `f` anymore.4949+5050+ ```nix5151+ nix-repl> fix = f:5252+ let self = f self; in self;5353+ ```5454+5555+ By applying `fix` we get the final result.5656+5757+ ```nix1658 nix-repl> fix f1759 { bar = "bar"; foo = "foo"; foobar = "foobar"; }1860 ```19616262+ Such a refactored `f` using `fix` is not useful by itself.6363+ See [`extends`](#function-library-lib.fixedPoints.extends) for an example use case.6464+ There `self` is also often called `final`.6565+2066 Type: fix :: (a -> a) -> a21672222- See https://en.wikipedia.org/wiki/Fixed-point_combinator for further2323- details.6868+ Example:6969+ fix (self: { foo = "foo"; bar = "bar"; foobar = self.foo + self.bar; })7070+ => { bar = "bar"; foo = "foo"; foobar = "foobar"; }7171+7272+ fix (self: [ 1 2 (elemAt self 0 + elemAt self 1) ])7373+ => [ 1 2 3 ]2474 */2575 fix = f: let x = f x; in x;2676
···1313, nativeImageBuildArgs ? [1414 (lib.optionalString stdenv.isDarwin "-H:-CheckToolchain")1515 "-H:Name=${executable}"1616+ "-march=compatibility"1617 "--verbose"1718 ]1819 # Extra arguments to be passed to the native-image
···11+# This file tracks the Clojure tools version required by babashka.22+# See https://github.com/borkdude/deps.clj#deps_clj_tools_version for background.33+# The `updateScript` provided in default.nix takes care of keeping it in sync, as well.44+{ clojure55+, fetchurl66+}:77+clojure.overrideAttrs (previousAttrs: {88+ pname = "babashka-clojure-tools";99+ version = "1.11.1.1403";1010+1111+ src = fetchurl {1212+ url = previousAttrs.src.url;1313+ hash = "sha256-bVNHEEzpPanPF8pfDP51d13bxv9gZGzqczNmFQOk6zI=";1414+ };1515+})
···66, writeScript77}:8899-buildGraalvmNativeImage rec {1010- pname = "babashka-unwrapped";1111- version = "1.3.184";99+let1010+ babashka-unwrapped = buildGraalvmNativeImage rec {1111+ pname = "babashka-unwrapped";1212+ version = "1.3.184";12131313- src = fetchurl {1414- url = "https://github.com/babashka/babashka/releases/download/v${version}/babashka-${version}-standalone.jar";1515- sha256 = "sha256-O3pLELYmuuB+Bf1vHTWQ+u7Ymi3qYiMRpCwvEq+GeBQ=";1616- };1414+ src = fetchurl {1515+ url = "https://github.com/babashka/babashka/releases/download/v${version}/babashka-${version}-standalone.jar";1616+ sha256 = "sha256-O3pLELYmuuB+Bf1vHTWQ+u7Ymi3qYiMRpCwvEq+GeBQ=";1717+ };17181818- graalvmDrv = graalvmCEPackages.graalvm-ce;1919+ graalvmDrv = graalvmCEPackages.graalvm-ce;19202020- executable = "bb";2121+ executable = "bb";21222222- nativeBuildInputs = [ removeReferencesTo ];2323+ nativeBuildInputs = [ removeReferencesTo ];23242424- extraNativeImageBuildArgs = [2525- "-H:+ReportExceptionStackTraces"2626- "--no-fallback"2727- "--native-image-info"2828- "--enable-preview"2929- ];3030-3131- doInstallCheck = true;3232-3333- installCheckPhase = ''3434- $out/bin/bb --version | grep '${version}'3535- $out/bin/bb '(+ 1 2)' | grep '3'3636- $out/bin/bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]' | grep '[1 2]'3737- '';3838-3939- # As of v1.2.174, this will remove references to ${graalvmDrv}/conf/chronology,4040- # not sure the implications of this but this file is not available in4141- # graalvm-ce anyway.4242- postInstall = ''4343- remove-references-to -t ${graalvmDrv} $out/bin/${executable}4444- '';4545-4646- passthru.updateScript = writeScript "update-babashka" ''4747- #!/usr/bin/env nix-shell4848- #!nix-shell -i bash -p curl common-updater-scripts jq4949-5050- set -euo pipefail5151-5252- readonly latest_version="$(curl \5353- ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \5454- -s "https://api.github.com/repos/babashka/babashka/releases/latest" \5555- | jq -r '.tag_name')"5656-5757- # v0.6.2 -> 0.6.25858- update-source-version babashka "''${latest_version/v/}"5959- '';6060-6161- meta = with lib; {6262- description = "A Clojure babushka for the grey areas of Bash";6363- longDescription = ''6464- The main idea behind babashka is to leverage Clojure in places where you6565- would be using bash otherwise.6666-6767- As one user described it:6868-6969- I’m quite at home in Bash most of the time, but there’s a substantial7070- grey area of things that are too complicated to be simple in bash, but7171- too simple to be worth writing a clj/s script for. Babashka really7272- seems to hit the sweet spot for those cases.7373-7474- Goals:7575-7676- - Low latency Clojure scripting alternative to JVM Clojure.7777- - Easy installation: grab the self-contained binary and run. No JVM needed.7878- - Familiarity and portability:7979- - Scripts should be compatible with JVM Clojure as much as possible8080- - Scripts should be platform-independent as much as possible. Babashka8181- offers support for linux, macOS and Windows.8282- - Allow interop with commonly used classes like java.io.File and System8383- - Multi-threading support (pmap, future, core.async)8484- - Batteries included (tools.cli, cheshire, ...)8585- - Library support via popular tools like the clojure CLI8686- '';8787- homepage = "https://github.com/babashka/babashka";8888- changelog = "https://github.com/babashka/babashka/blob/v${version}/CHANGELOG.md";8989- sourceProvenance = with sourceTypes; [ binaryBytecode ];9090- license = licenses.epl10;9191- maintainers = with maintainers; [9292- bandresen9393- bhougland9494- DerGuteMoritz9595- jlesquembre9696- thiagokokada2525+ extraNativeImageBuildArgs = [2626+ "-H:+ReportExceptionStackTraces"2727+ "--no-fallback"2828+ "--native-image-info"2929+ "--enable-preview"9730 ];3131+3232+ doInstallCheck = true;3333+3434+ installCheckPhase = ''3535+ $out/bin/bb --version | grep '${version}'3636+ $out/bin/bb '(+ 1 2)' | grep '3'3737+ $out/bin/bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]' | grep '[1 2]'3838+ '';3939+4040+ # As of v1.2.174, this will remove references to ${graalvmDrv}/conf/chronology,4141+ # not sure the implications of this but this file is not available in4242+ # graalvm-ce anyway.4343+ postInstall = ''4444+ remove-references-to -t ${graalvmDrv} $out/bin/${executable}4545+ '';4646+4747+ passthru.updateScript = writeScript "update-babashka" ''4848+ #!/usr/bin/env nix-shell4949+ #!nix-shell -i bash -p curl common-updater-scripts jq libarchive5050+5151+ set -euo pipefail5252+ shopt -s inherit_errexit5353+5454+ latest_version="$(curl \5555+ ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \5656+ -fsL "https://api.github.com/repos/babashka/babashka/releases/latest" \5757+ | jq -r '.tag_name')"5858+5959+ if [ "$(update-source-version babashka-unwrapped "''${latest_version/v/}" --print-changes)" = "[]" ]; then6060+ # no need to update babashka.clojure-tools when babashka-unwrapped wasn't updated6161+ exit 06262+ fi6363+6464+ clojure_tools_version=$(curl \6565+ -fsL \6666+ "https://github.com/babashka/babashka/releases/download/''${latest_version}/babashka-''${latest_version/v/}-standalone.jar" \6767+ | bsdtar -qxOf - borkdude/deps.clj \6868+ | ${babashka-unwrapped}/bin/bb -I -o -e "(or (some->> *input* (filter #(= '(def version) (take 2 %))) first last last last) (throw (ex-info \"Couldn't find expected '(def version ...)' form in 'borkdude/deps.clj'.\" {})))")6969+7070+ update-source-version babashka.clojure-tools "$clojure_tools_version" \7171+ --file="pkgs/development/interpreters/babashka/clojure-tools.nix"7272+ '';7373+7474+ meta = with lib; {7575+ description = "A Clojure babushka for the grey areas of Bash";7676+ longDescription = ''7777+ The main idea behind babashka is to leverage Clojure in places where you7878+ would be using bash otherwise.7979+8080+ As one user described it:8181+8282+ I’m quite at home in Bash most of the time, but there’s a substantial8383+ grey area of things that are too complicated to be simple in bash, but8484+ too simple to be worth writing a clj/s script for. Babashka really8585+ seems to hit the sweet spot for those cases.8686+8787+ Goals:8888+8989+ - Low latency Clojure scripting alternative to JVM Clojure.9090+ - Easy installation: grab the self-contained binary and run. No JVM needed.9191+ - Familiarity and portability:9292+ - Scripts should be compatible with JVM Clojure as much as possible9393+ - Scripts should be platform-independent as much as possible. Babashka9494+ offers support for linux, macOS and Windows.9595+ - Allow interop with commonly used classes like java.io.File and System9696+ - Multi-threading support (pmap, future, core.async)9797+ - Batteries included (tools.cli, cheshire, ...)9898+ - Library support via popular tools like the clojure CLI9999+ '';100100+ homepage = "https://github.com/babashka/babashka";101101+ changelog = "https://github.com/babashka/babashka/blob/v${version}/CHANGELOG.md";102102+ sourceProvenance = with sourceTypes; [ binaryBytecode ];103103+ license = licenses.epl10;104104+ maintainers = with maintainers; [105105+ bandresen106106+ bhougland107107+ DerGuteMoritz108108+ jlesquembre109109+ thiagokokada110110+ ];111111+ };98112 };9999-}113113+in114114+babashka-unwrapped
···268268269269@cli.command("update-all")270270def update_all():271271- repos = Parallel(n_jobs=2, require='sharedmem')(delayed(get_electron_info)(major_version) for major_version in range(27, 24, -1))271271+ repos = Parallel(n_jobs=2, require='sharedmem')(delayed(get_electron_info)(major_version) for major_version in range(28, 24, -1))272272 out = {n[0]: n[1] for n in Parallel(n_jobs=2, require='sharedmem')(delayed(get_update)(repo) for repo in repos)}273273274274 with open('info.json', 'w') as f:
···781781 sane-backends-git = sane-backends; # Added 2021-02-19782782 scantailor = scantailor-advanced; # Added 2022-05-26783783 sdlmame = throw "'sdlmame' has been renamed to/replaced by 'mame'"; # Converted to throw 2023-09-10784784+ searx = throw "'searx' has been removed as it is unmaintained. Please switch to searxng"; # Added 2023-10-03784785 session-desktop-appimage = session-desktop;785786 sequoia = sequoia-sq; # Added 2023-06-26786787 sexp = sexpp; # Added 2023-07-03···927926 win-qemu = throw "'win-qemu' has been replaced by 'win-virtio'"; # Added 2023-08-16928927 win-signed-gplpv-drivers = throw "win-signed-gplpv-drivers has been removed from nixpkgs, as it's unmaintained: https://help.univention.com/t/installing-signed-gplpv-drivers/21828"; # Added 2023-08-17929928 wlroots_0_14 = throw "'wlroots_0_14' has been removed in favor of newer versions"; # Added 2023-07-29929929+ wordpress6_1 = throw "'wordpress6_1' has been removed in favor of the latest version"; # Added 2023-10-10930930+ wordpress6_2 = throw "'wordpress6_2' has been removed in favor of the latest version"; # Added 2023-10-10930931 wormhole-rs = magic-wormhole-rs; # Added 2022-05-30. preserve, reason: Arch package name, main binary name931932 wmii_hg = wmii;932933 wxGTK30 = throw "wxGTK30 has been removed from nixpkgs as it has reached end of life"; # Added 2023-03-22