From 76f22af9d5ee552aa7b5b0000143943005c5f4d7 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 3 Dec 2025 13:36:33 -0800 Subject: [PATCH] chore: format --- infiniteadaptability/packages/bun.scm | 4 +- infiniteadaptability/packages/elixir.scm | 77 +++++++++++-------- infiniteadaptability/packages/pulumi.scm | 6 +- .../services/bitcoin-core.scm | 2 +- 4 files changed, 51 insertions(+), 38 deletions(-) diff --git a/infiniteadaptability/packages/bun.scm b/infiniteadaptability/packages/bun.scm index 16cd806..3f846d4 100644 --- a/infiniteadaptability/packages/bun.scm +++ b/infiniteadaptability/packages/bun.scm @@ -33,7 +33,9 @@ #:patchelf-plan `'(("bun" ("gcc" "gcc-toolchain" "glibc"))) #:install-plan #~'(("bun" "bin/")))) - (inputs `((,gcc "lib") ,gcc-toolchain ,glibc)) + (inputs `((,gcc "lib") + ,gcc-toolchain + ,glibc)) (native-inputs (list unzip)) (synopsis "Bun is an all-in-one toolkit for JavaScript and TypeScript apps.") diff --git a/infiniteadaptability/packages/elixir.scm b/infiniteadaptability/packages/elixir.scm index 5dd0639..4dd63f3 100644 --- a/infiniteadaptability/packages/elixir.scm +++ b/infiniteadaptability/packages/elixir.scm @@ -20,18 +20,21 @@ (file-name (git-file-name name version)) (sha256 (base32 "0556xjkh5229afl22av2g8gkq5ak0gfipm90ybgnq2d2brd714xh")))) - (arguments + (arguments (list #:test-target "test" #:parallel-tests? #f ;see - #:make-flags #~(list (string-append "PREFIX=" #$output)) + #:make-flags + #~(list (string-append "PREFIX=" + #$output)) #:phases #~(let* ((compiler-path "lib/elixir/src/elixir_erl_compiler.erl") (compiler-path-orig (string-append compiler-path ".orig"))) (modify-phases %standard-phases (add-after 'unpack 'make-git-checkout-writable (lambda _ - (for-each make-file-writable (find-files ".")))) + (for-each make-file-writable + (find-files ".")))) (add-after 'make-git-checkout-writable 'replace-paths (lambda* (#:key inputs #:allow-other-keys) ;; Note: references end up obfuscated in binary BEAM files @@ -40,47 +43,50 @@ (substitute* '("lib/mix/lib/mix/release.ex" "lib/mix/lib/mix/tasks/release.init.ex") (("#!/bin/sh") - (string-append "#!" (search-input-file inputs "/bin/sh")))) + (string-append "#!" + (search-input-file inputs "/bin/sh")))) (substitute* "bin/elixir" (("ERTS_BIN=\n") - (string-append - "ERTS_BIN=" - ;; Elixir Releases will prepend to ERTS_BIN the path of - ;; a copy of erl. We detect if a release is being - ;; generated by checking the initial ERTS_BIN value: if - ;; it's empty, we are not in release mode and can point - ;; to the actual erl binary in Guix store. - "\nif [ -z \"$ERTS_BIN\" ]; then ERTS_BIN=" - (string-drop-right - (search-input-file inputs "/bin/erl") 3) - "; fi\n"))) + (string-append "ERTS_BIN=" + ;; Elixir Releases will prepend to ERTS_BIN the path of + ;; a copy of erl. We detect if a release is being + ;; generated by checking the initial ERTS_BIN value: if + ;; it's empty, we are not in release mode and can point + ;; to the actual erl binary in Guix store. + "\nif [ -z \"$ERTS_BIN\" ]; then ERTS_BIN=" + (string-drop-right (search-input-file inputs + "/bin/erl") 3) + "; fi\n"))) (substitute* "bin/mix" (("#!/usr/bin/env elixir") - (string-append "#!" #$output "/bin/elixir"))) + (string-append "#!" + #$output "/bin/elixir"))) ;; We should not brake the formatting, so we need patch the ;; following more accurately. (substitute* "lib/mix/test/mix/tasks/cmd_test.exs" - (("File\\.mkdir_p!\\(\"priv\"\\)" all) + (("File\\.mkdir_p!\\(\"priv\"\\)" all) (string-append all "\n sh = \"" (search-input-file inputs "/bin/sh") "\"")) - (("#!/bin/sh") "#!#{sh}")))) + (("#!/bin/sh") + "#!#{sh}")))) (add-after 'replace-paths 'pre-install-source (lambda* (#:key outputs #:allow-other-keys) - (copy-recursively - "lib" - (string-append (assoc-ref outputs "src") "/source/lib")))) + (copy-recursively "lib" + (string-append (assoc-ref outputs "src") + "/source/lib")))) (add-after 'pre-install-source 'patch-elixir-compiler ;; Temporarily patch the compiler to place correct source ;; locations into module info instead of build directory. (lambda* (#:key outputs #:allow-other-keys) (copy-recursively compiler-path compiler-path-orig) - (let ((source (string-append "/tmp/guix-build-" #$name "-" + (let ((source (string-append "/tmp/guix-build-" + #$name "-" #$version ".drv-0")) (destination (assoc-ref outputs "src"))) (substitute* compiler-path (("source, Source") - (string-append "source, string:replace(Source, \"" - source "\", \"" destination "\")")))))) + (string-append "source, string:replace(Source, \"" source + "\", \"" destination "\")")))))) (add-before 'build 'set-deterministic (lambda _ ;; Set deterministic compiler option. @@ -90,8 +96,12 @@ (lambda _ (copy-recursively compiler-path-orig compiler-path) (delete-file compiler-path-orig) - (invoke "erlc" "-I" "lib/elixir/include" - "-o" "lib/elixir/ebin" compiler-path))) + (invoke "erlc" + "-I" + "lib/elixir/include" + "-o" + "lib/elixir/ebin" + compiler-path))) (add-after 'restore-and-recompile 'make-current ;; The Elixir compiler checks whether or not to compile files ;; by inspecting their timestamps. When the timestamp is @@ -116,20 +126,19 @@ ;; mix into shell script. (substitute* (string-append out "/bin/mix") (("Mix.CLI.main\\(\\)") - (format #f "\ -~~w[GUIX_ELIXIR_LIBS ERL_LIBS] + (format #f + "~~w[GUIX_ELIXIR_LIBS ERL_LIBS] |> Enum.map(&System.get_env/1) |> Enum.reject(&is_nil/1) |> Enum.join(\":\") |> case do \"\" -> :ok; erl_libs -> System.put_env(\"ERL_LIBS\", erl_libs) end System.put_env(\"MIX_REBAR3\", System.get_env(\"MIX_REBAR3\", \"~a\")) Mix.CLI.main()" - (search-input-file inputs "/bin/rebar3")))) - (for-each - (lambda (program) - (wrap-program (string-append out "/bin/" program) - '("ERL_LIBS" prefix ("${GUIX_ELIXIR_LIBS}")))) - programs)))))))) + (search-input-file inputs "/bin/rebar3")))) + (for-each (lambda (program) + (wrap-program (string-append out "/bin/" program) + '("ERL_LIBS" prefix + ("${GUIX_ELIXIR_LIBS}")))) programs)))))))) (inputs (modify-inputs (package-inputs elixir) (replace "erlang" erlang-28.1.1) (replace "rebar3" rebar))))) diff --git a/infiniteadaptability/packages/pulumi.scm b/infiniteadaptability/packages/pulumi.scm index d0b05c4..0561ae4 100644 --- a/infiniteadaptability/packages/pulumi.scm +++ b/infiniteadaptability/packages/pulumi.scm @@ -16,7 +16,8 @@ (source (origin (method url-fetch) - (uri (string-append "https://get.pulumi.com/releases/sdk/pulumi-v" version "-linux-x64.tar.gz")) + (uri (string-append "https://get.pulumi.com/releases/sdk/pulumi-v" + version "-linux-x64.tar.gz")) (sha256 (base32 "14pqc1qvkb8jp2wisld02qm6zf68i3i3iyymiwgg2ngr1ps40191")))) (supported-systems '("x86_64-linux")) @@ -25,7 +26,8 @@ (list #:substitutable? #f #:install-plan - #~'(("." "bin/" #:exclude ("pulumi-watch"))))) + #~'(("." "bin/" + #:exclude ("pulumi-watch"))))) (synopsis "Pulumi") (description "pulumi") (license license:unlicense) diff --git a/infiniteadaptability/services/bitcoin-core.scm b/infiniteadaptability/services/bitcoin-core.scm index fe9df29..5418479 100644 --- a/infiniteadaptability/services/bitcoin-core.scm +++ b/infiniteadaptability/services/bitcoin-core.scm @@ -87,7 +87,7 @@ activation)) (let ((user (getpw #$username))) (mkdir-p/perms #$datadir - user #o755)) + user 493)) (make-forkexec-constructor #$bitcoind-command #:pid-file #$pid-file -- 2.52.0