Commit graph

2359 commits

Author SHA1 Message Date
Rutherther
65bb0d92d8
pack: Singularity environemt sources the profile's 'etc/profile'.
Fixes #419 where the same search path is used multiple times, leading to the
last one overriding the previous one.

The solution relies on the #$profile/etc/profile file that is already verified
and in case of errors, it is just one place to repair instead of repairing at
multiple places, like in singularity-environment-file

* guix/pack.scm (singularity-environment-file): Source #$profile/etc/profile

Reported-by: Alexis Simon <alexis.simon@runbox.com>
Change-Id: Ic304fef99ad34d83e4e10cdd2b26d3b1802b5251
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-06-13 14:01:38 +02:00
Morgan Arnold
b5745a327e
publish: Prevent publication of non-substitutable derivation outputs.
This commit prevents Guix substitute servers from distributing binaries
which are marked non-substitutable.  This prevents substitute servers
from accidentally committing copyright violations by distributing
binaries that are non-substitutable for copyright reasons.

* guix/scripts/publish.scm (render-nar): Query the derivers of
‘store-path’ and do nothing if one of them does not match
‘substitutable-derivation?’.
* tests/publish.scm ("non-substitutable derivation"): New test.

Change-Id: Iaca81f5bdb430a12a3ad41e9b83e0bcc535af607
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Modified-by: Ludovic Courtès <ludo@gnu.org>
2025-06-06 18:41:19 +02:00
Tomas Volf
5c5c5a6e58
environment: Set LANG by default.
* guix/scripts/environment.scm (launch-environment/container): Set LANG
to C.UTF-8 unless already set.

Change-Id: I2dba595c8d5f4e9b45264f8185c72779fead2ce6
Signed-off-by: Ekaitz Zarraga <ekaitz@elenq.tech>
2025-06-03 19:28:35 +02:00
Ray Miller
b48b2bcf42
pack: Include store parent directories in the Docker layer.
Fixes <https://issues.guix.gnu.org/78210>.

This patch adds the /gnu and /gnu/store directories to the Docker layer
created by ‘guix pack -f docker …’, which enables the Docker image to be
used to create an AWS Lambda function.  Without the patch, creating the
AWS Lambda function fails with this error:

  "MissingParentDirectory: Parent directory does not exist for file: gnu/store/…-info-dir/"

* guix/scripts/pack.scm (docker-image)[build]: Add store directory to
the docker layer.
* guix/docker.scm (build-docker-image): Change order of arguments to
‘tar’ so parent directories are added before their contents.

Change-Id: I2b103c59981e828c965564ccc5d2415b00a7e52e
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-06-03 15:09:54 +02:00
Nicolas Graves
ec6757d00c
scripts: environment: Export launch-environment/container.
* guix/scripts/environment.scm (launch-environment/container): Export.

Change-Id: I98d1b3e785015b34f4b434ccd931d8cf8988ee3c
Signed-off-by: Hilton Chain <hako@ultrarare.space>
2025-05-31 21:42:58 +08:00
Ludovic Courtès
f8527e7f20
environment: Provide a writable /run/user/$UID.
* guix/scripts/environment.scm (launch-environment/container): Add
/run/user/UID to ‘file-systems’.
* tests/guix-environment-container.sh: Test it.

Change-Id: I44c70a7554a06f40d073c25929ea7c6ded356d08
2025-05-24 12:48:05 +02:00
Ludovic Courtès
5e47bafb37
describe: Recognize git.guix.gnu.org for commit hyperlinks.
* guix/scripts/describe.scm (%vcs-web-views): Add git.guix.gnu.org.

Change-Id: I47ded4618dec3073925efdfa5df87ab47643f8c4
2025-05-23 11:17:59 +02:00
Liliana Marie Prikler
9013a53705
import/elpa: Improve CLI documentation for archive flag.
* guix/import/elpa.scm (elpa-url)[elpa-archives]: Move from here…
(%elpa-archives): … to here.
* guix/scripts/import/elpa.scm (%options): Add “list-archives”.
(show-help): Adjust accordingly.

Change-Id: Ib686bd9ff5eff2d4c37b8751ec1410666d568c1f
Co-authored-by: jgart <jgart@dismail.de>
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2025-05-22 11:18:08 +02:00
Maxim Cournoyer
271a8fc249
refresh: Allow specifying a partial version via the version specification.
* guix/scripts/refresh.scm (update-specification->update-spec): Flag the
update-spec as partial when it is prefixed with '~'.
* tests/guix-refresh.sh: Test it.  Remove extraneous 'guix refresh'
invocation.
* doc/guix.texi (Invoking guix refresh): Document it.

Change-Id: Iab4482d9367105f6ffcd2d6a49148736c93d53e4
Reviewed-by: Florian Pelz <pelzflorian@pelzflorian.de>
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2025-05-19 10:07:24 +09:00
Tomas Volf
11e88de060
environment: Make home writable.
Fixes <https://issues.guix.gnu.org/78363>.

* guix/scripts/environment.scm (launch-environment/container): Add tmpfs for
home.
* tests/guix-environment-container.sh: Add test.

Change-Id: Iadd9b838f6442a8080998ed7e07414db562068bf
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-05-18 22:55:54 +02:00
Tomas Volf
7a888d9841
environment: Translate only file names under home directory.
* guix/scripts/environment.scm (file-name-equal-or-under?): New procedure.
(override-user-mappings, override-user-dir): Use it.

Change-Id: Iadd9b838f6442a8080998ed7e07414db562068bf
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-05-18 22:55:54 +02:00
Tomas Volf
8654aecf74
environment: Use inherit for new mapping.
* guix/scripts/environment.scm (override-user-mappings): Use inherit.

Change-Id: Iadd9b838f6442a8080998ed7e07414db562068bf
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-05-18 22:55:54 +02:00
Ludovic Courtès
edc799dabf
environment, home: Make /tmp writable.
Fixes <https://issues.guix.gnu.org/78272>.

Fixes a bug caused by commit ce363c1dc7,
which inadvertently made /tmp read-only as well.

* guix/scripts/environment.scm (launch-environment/container)[tmpfs]:
New variable.
Add it to ‘file-systems’.
* guix/scripts/home.scm (spawn-home-container): Add /tmp file system
to #:mounts.
* tests/guix-environment-container.sh: Add test.

Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I5cb449e6d0c213d4b5866cbcbd14990437a7d4c5
2025-05-06 12:22:34 +02:00
Ludovic Courtès
e1a0171a56
linux-container: Set up “lo” and generate /etc/hosts by default.
* gnu/build/linux-container.scm (run-container): Add #:loopback-network?
and honor it via #:populate-file-system.
(call-with-container): Add #:loopback-network? and pass it to
‘run-container’.
* guix/scripts/environment.scm (launch-environment/container): Remove
call to ‘set-network-interface-up’ and remove generation of /etc/hosts.
* guix/scripts/home.scm (spawn-home-container): Likewise.

Change-Id: I5933a4e8dc6d8e19235a79696b62299d74d1ba21
2025-05-05 14:34:00 +02:00
Ludovic Courtès
ce363c1dc7
environment: Add ‘--writable-root’ and default to read-only root.
This is an incompatible change where the root file system in
‘guix shell -C’ is now read-only by default.

* guix/scripts/environment.scm (show-environment-options-help)
(%options): Add ‘--writable-root’.
* guix/scripts/environment.scm (setup-fhs): Invoke /sbin/ldconfig; moved
from…
(launch-environment): … here.
(launch-environment/container): Add #:writable-root? and pass it to
‘call-with-container’.  Move root file system setup to #:populate-file-system.
(guix-environment*): Honor ‘--writable-root’.
* tests/guix-environment-container.sh: Test it.
* doc/guix.texi (Invoking guix shell): Document ‘--writable-root’.
(Debugging Build Failures): Mention it before “rm /bin/sh”.

Change-Id: I2e8517d6f01eb8093160bffc0f9f56071ad6fee6
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2025-05-05 14:33:59 +02:00
Ludovic Courtès
7d28e6512c
guix home: ‘container’ provides a read-only root file system.
* guix/scripts/home.scm (spawn-home-container): Move creation of
accounts, /etc/hosts, /tmp, and HOME-DIRECTORY from the first argument
of ‘eval/container’ to #:populate-file-system.  Remove #:writable-root?.
* tests/guix-home.sh: Test that the root file system is read-only.

Change-Id: Icda54706321d51b95b563c86c3fb2238cc65ee20
2025-05-05 14:33:59 +02:00
Ludovic Courtès
a391394a22
linux-container: Support having a read-only root file system.
Until now, the read-only file system set up by ‘call-with-container’
would always be writable.  With this change, it can be made read-only.
With this patch, only ‘least-authority-wrapper’ switches to a read-only
root file system.

* gnu/build/linux-container.scm (remount-read-only): New procedure.
(mount-file-systems): Add #:writable-root? and #:populate-file-system
and honor them.
(run-container): Likewise.
(call-with-container): Likewise.
* gnu/system/linux-container.scm (container-script): Pass #:writable-root?
to ‘call-with-container’.
(eval/container): Add #:populate-file-system and #:writable-root? and
honor them.
* guix/scripts/environment.scm (launch-environment/container):
Pass #:writable-root? to ‘call-with-container’.
* guix/scripts/home.scm (spawn-home-container): Likewise.
* tests/containers.scm ("call-with-container, mnt namespace, read-only root")
("call-with-container, mnt namespace, writable root"): New tests.

Change-Id: I603e2fd08851338b737bb16c8af3f765e2538906
2025-05-05 14:33:59 +02:00
Ludovic Courtès
acc4215644
guix home: ‘container’ explicitly mounts $HOME and /run/user/1000.
* guix/scripts/home.scm (spawn-home-container): Pass #:mounts to
‘eval/container’.

Change-Id: I1986c1411711cebaf623f97897d91436d8167037
2025-05-05 14:33:59 +02:00
Tomas Volf
a2282c68ff
environment: Restore action for SIGPIPE.
Code in `ui.scm' in `initialize-guix' procedure changes the handling of
SIGPIPE to SIG_IGN.  So restore the handling to SIG_DFL so that process
executed will have the usual action.  Technically we should record what the
handling was, and restore it to the previous value, but that would be much
more invasive change.

Always setting it to SIG_DFL is at least less surprising than always setting
to SIG_IGN.

* guix/scripts/environment.scm (launch-environment): Restore default action
for SIGPIPE.

Change-Id: Ifabae1d3e71aa44e63078cea5bd3824b8f61ba14
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-05-05 12:15:55 +02:00
Hilton Chain
415e3d98d6
scripts: home: Support extracting home-environment from Guix System declaration.
* guix/scripts/home.scm (process-action): Handle operating-system declaration
and extract home environment for current user.
* doc/guix.texi (Guix Services)[Guix Home Service]: Document it.

Change-Id: I995f79c2549e6edc76322542d0422159e0b79996
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>
2025-05-03 15:53:46 +08:00
Yelninei
c9ac6c8715
locate: Request writable db for --clear.
Fixes <https://issues.guix.gnu.org/76141>.

* guix/scripts/locate.scm (guix-locate): Use writable db when --clear is given.

Change-Id: I2e4e945cef022b08dd6af4c252e67c2a4d5bf38c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-16 18:20:44 +02:00
Ludovic Courtès
dfac0a5a95
guix: Avoid ‘fdatasync’ call for caches and regular files.
Fixes <https://issues.guix.gnu.org/77606>.

Calling ‘fdatasync’ for each and every narinfo file created by ‘guix
substitute’ proved to be too expensive on spinning HDDs and/or under
load (from 0.1s to 1.3s for the ‘fdatasync’ call alone).

* guix/git-authenticate.scm (cache-authenticated-commit): Pass #:sync? #f.
* guix/http-client.scm (http-fetch/cached): Likewise.
* guix/scripts/discover.scm (write-publish-file): Likewise.
* guix/scripts/style.scm (format-whole-file): Likewise.
* guix/substitutes.scm (cache-narinfo!): Likewise.

Reported-by: Christopher Baines <mail@cbaines.net>
Change-Id: I82297eae737bc5aae8a3f7604119e9f3d4b625bf
2025-04-14 17:31:50 +02:00
Nicolas Graves
67d640ef36
guix: scripts: system: Export report-shepherd-error.
* (guix/scripts/system.scm): Export report-shepherd-error.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-01 14:49:34 +02:00
Nicolas Graves
b6d89759a7
guix: scripts: reconfigure: Export running-services variable.
* (guix/scripts/reconfigure.scm): Export running-services variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-01 14:49:34 +02:00
Nicolas Graves
ebb2f7818c
guix: scripts: system: Export profile-boot-parameters function.
* (guix/scripts/system.scm): Export profile-boot-parameters function.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-01 14:49:33 +02:00
Maxim Cournoyer
ec8e15584c
refresh: Set default value of `key-download' option to 'auto.
This is a follow-up to commit 79a46d6537 ("gnupg: Automatically fallback to
'always policy when non-interactive."), which introduced the following
problem:

  guix refresh --update libvirt
   -> guix refresh: error: invalid key-download policy: #f

* guix/scripts/refresh.scm (%default-options): Set default key-download option
value to 'auto.
(%options): Accept auto as a valid value from the command line.

Change-Id: I45ceee8e07d1a3a3c377e12ed017813f92289565
2025-03-05 22:44:15 +09:00
Ludovic Courtès
749eb1a2dd
services: ‘shepherd-service-upgrade’ handles canonical name changes.
Partly fixes <https://issues.guix.gnu.org/76315>.

Fixes a bug whereby a service whose canonical name has changed would not
be restarted—e.g., if '(syslogd) has a replacement providing
'(system-log syslogd).

* gnu/services/shepherd.scm (shepherd-service-upgrade)[running?]:
Remove.
[to-restart]: Change to a subset of LIVE.  Look up all the names of each
element of TARGET.
* guix/scripts/system/reconfigure.scm (upgrade-shepherd-services):
TO-RESTART is now a list of <live-service>; adjust accordingly.
* tests/services.scm ("shepherd-service-upgrade: one unchanged, one upgraded, one new"):
("shepherd-service-upgrade: service depended on is not unloaded"):
("shepherd-service-upgrade: obsolete services that depend on each other"):
("shepherd-service-upgrade: transient service"): Adjust accordingly.
("shepherd-service-upgrade: service has new canonical name"): New test.

Reported-by: Tomas Volf <~@wolfsden.cz>
Change-Id: I7cec495b4e824da5fad5518f039607cf92f935d9
2025-03-05 00:28:49 +01:00
Christopher Baines
b55e3b1a4b
publish: Call (current-processor-count) later.
So that this is evaluated when the main part of the script runs.

I'm looking at this to allow using setaffinity in the publish tests.

* guix/scripts/publish.scm (%default-options): Remove workers default.
(guix-publish): Move the default to here.

Change-Id: I83cd0d048f2641291b5bd8a932b479b23dd92d29
2025-03-03 20:14:54 +00:00
Efraim Flashner
98be4efdb8
guix build: Honor '--system' with '--manifest'.
* guix/scripts/build.scm (options->things-to-build): Wrap the manifest
build option with the result of the '--system' option.

Change-Id: I1c3ff93af56bb659ddc00e1872c769cfc5e7a0d5
2025-03-02 16:46:59 +02:00
Arun Isaac
b0d3a38f4c
deploy: Add --roll-back option.
* guix/scripts/deploy.scm (guix-deploy): Add the --roll-back option.
(show-what-to-deploy): Add #:roll-back? argument.
(roll-back-machine*): New function.
(show-help): Document the --roll-back option.
* doc/guix.texi (Invoking guix deploy): Document the --roll-back option.

Change-Id: Ic5084f287aefb2d1d28380ca4ba1c6971cb913e7
2025-03-01 00:18:38 +00:00
Maxim Cournoyer
f13f076968
refresh: Add support for partial target versions.
* guix/import/utils.scm (find-version): New procedure.
* guix/scripts/refresh.scm (<update-spec>) [partial?]: New field.
(update-spec-partial?): New accessor.
(update-spec): Add a PARTIAL? optional argument.
(update-specification->update-spec) <update-spec>: Call with its new PARTIAL?
optional argument when FALLBACK-VERSION is provided, i.e. when
'--target-version' was used.
(update-package): Remove the PACKAGE and VERSION positional arguments, and
replace them with UPDATE-SPEC.  Update doc.  Call `package-update' with its
new #:partial-version? argument.
(check-for-package-update) <package-latest-release>: Pass the new
 #:partial-version? argument to it.
(guix-refresh) <update-package>: Adjust call accordingly.
(show-help): Udate doc.
* guix/upstream.scm (package-latest-release): Add #:partial-version? argument,
and apply it to the importer call.
(package-update): Add #:partial-version?> argument.  Update doc.  Pass it to
the `package-latest-release' call.
* guix/gnu-maintenance.scm (rewrite-url): Add #:partial-version? argument.
Update doc.  Crawl URL for newer compatible versions when provided.
(import-html-release): Add #:partial-version? argument, and pass it to the
`rewrite-url' call.  Use `find-version' to find the best version.
(import-release, import-ftp-release, import-gnu-release)
(import-release*): Add #:partial-version? argument and honor it.
(import-html-updatable-release): Add #:partial-version? argument, and pass it
to the `import-html-release' call.
* guix/import/gnome.scm (import-gnome-release)
<#:partial-version?>: Add new argument and honor it.
* guix/import/texlive.scm (latest-texlive-tag): Rename to...
(texlive-tags): ... this, and have it return all tags.
(texlive->guix-package): Adjust accordingly.
(latest-release): Add a #:partial-version? argument.  Update doc.
* guix/import/stackage.scm (latest-lts-release): New #:partial-version?
argument.
* guix/import/pypi.scm (import-release): New #:partial-version? argument; pass
it to `pypi-package->upstream-source'.
* guix/import/opam.scm (latest-release): New #:partial-version? argument.
* guix/import/minetest.scm (latest-minetest-release): New #:partial-version?
argument.
(pypi-package->upstream-source): New #:partial-version? argument.  Update doc.
* guix/import/launchpad.scm (latest-released-version): Rename to...
(release-versions): ... this, making it return all versions.
(import-release) <#:partial-version?>: New argument.
* guix/import/kde.scm (import-kde-release)
<#:partial-version?>: New argument.  Update doc.  Refactor to honor argument.
* guix/import/hexpm.scm (lookup-hexpm): Update doc.
(hexpm-latest-release): Rename to...
(hexpm-releases): ... this; return all release strings.
(hexpm->guix-package): Adjust accordingly.
(import-release): Add and honor a #:partial-version? argument.  Update doc.
* guix/import/hackage.scm (import-release): New #:partial-version? argument.
* guix/import/cpan.scm (latest-release): New #:partial-version? argument.
* guix/import/crate.scm (max-crate-version-of-semver): Improve doc.
(import-release): Add a #:partial-version? argument and honor it.
* guix/import/egg.scm (find-latest-version): Rename to...
(get-versions): ... this, returning all versions.
(egg-metadata): Adjust accordingly.
(egg->guix-package): Likewise.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/elpa.scm (latest-release):  New #:partial-version? argument.
* guix/import/gem.scm (get-versions): New procedure.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/git.scm (version-mapping): Update doc; streamline a bit.
(latest-tag): Rename to...
(get-tags): ... this, dropping the #:version keyword and returning the complete
tags alist.  Update doc.
(latest-git-tag-version): Rename to...
(get-package-tags): ... this, returning the complete tags alist of the
package.  Update doc.
(import-git-release): Add a new #:partial-version? argument and honor it.
Update doc.
* guix/import/github.scm (latest-released-version): Rename to...
(get-package-tags): ... this, returning all tags.  Update doc.
(import-release): Add a new #:partial-version? argument and honor it.
* guix/import/cran.scm (latest-cran-release)
(latest-bioconductor-release): Add #:partial-version? argument.
* guix/import/composer.scm (latest-version): Delete procedure.
(composer-fetch): Add #:partial-version? keyword and honor it.  Update doc.
(import-release): Likewise.
* guix/import/test.scm (import-release): Add #:partial-version? argument.
* tests/guix-refresh.sh: Add test.
* tests/gem.scm (test-foo-versions-json): New variable.
(package-latest-release): Mock new URL.
* tests/import-git.scm (latest-git-tag-version): New procedure.
* tests/gnu-maintenance.scm (libuv-dist-html)
(libuv-dist-1.46.0-html, libuv-dist-1.44.2-html)
(libuv-html-data): New variables.
(mock-http-fetch/cached): New procedure.
("rewrite-url, without to-version"): Rewrite using the above.
("rewrite-url, partial to-version"): New test.
* doc/guix.texi <"Invoking guix refresh">: Update doc.

Series-to: 75871@debbugs.gnu.org
Change-Id: I092a58b57ac42e54a2fa55e7761e8c6993af8ad4
2025-02-28 13:36:44 +09:00
Maxim Cournoyer
79a46d6537
gnupg: Automatically fallback to 'always policy when non-interactive.
Previously to this change, the 'guix refresh' download
policy (--key-download)would default to 'interactive', which would throw a
backtrace when guix was invoked with its stdin not connected to a peusdo
terminal (tty).  This change makes the new default value 'auto' use
interactive only in an interactive environment, with 'always' used as
fallback.

* doc/guix.texi (Invoking guix refresh): Adjust doc.
* etc/completion/fish/guix.fish: Adjust accordingly.
* etc/completion/zsh/_guix (_guix_list_installed_packages): Likewise.
* guix/gnupg.scm (gnupg-verify*): Change default #:key-download argument value
to 'auto.  Update doc.  Validate argument.  Raise an error in case read-line
returns #<eof>.
* guix/import/gnu.scm (gnu-package->sexp): <#:key-download>: Change default
value to 'auto.
* guix/import/gnu.scm (gnu->guix-package): <#:key-download>: Likewise.
* guix/scripts/import/gnu.scm (%options): Add "auto" to accepted
--key-download values.
(%default-options): Set default key-download option to the 'auto value.
(show-help): Update doc.
* guix/scripts/refresh.scm (show-help): Update doc.
(update-package) <#:key-download>: Change default value to 'auto.  Update doc.
* guix/upstream.scm (download-tarball): <#:key-download>: Likewise.
(package-update): Likewise.

Change-Id: Id1ca8fd6d453ca4bc5b372534445e3beab9133a8
Fixes: https://issues.guix.gnu.org/76112
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 13:36:44 +09:00
Ludovic Courtès
59167a010b
time-machine: Remove unused binding from #:select.
* guix/scripts/time-machine.scm: Remove unused binding from #:select.

Change-Id: I2e6ff09f02659a8967d10f98ad30d638808dbf1c
2025-02-24 23:33:51 +01:00
Vagrant Cascadian
70353a898b
guix: Fix typos.
* guix/build/kconfig.scm (modify-deconfig): Fix spelling of "abbreviation".
* guix/docker.scm (build-docker-image): Fix spelling of "split".
* guix/scripts/pack.scm (docker-image): Fix spelling of  "split".
2025-02-20 11:54:55 -08:00
Efraim Flashner
e582903481
guix: Fix some misspellings.
Change-Id: Ia036217dadc1624c5f0d59fd44f646d46315c1f3
2025-02-19 11:28:40 +02:00
Herman Rimm
c346614c3e
scripts: style: Only sort packages with string literal name.
* guix/scripts/style.scm (order-packages): Only match string literals.

Change-Id: I48a5976930501c20415b5413966b5294958bc23b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09 18:20:41 +01:00
Herman Rimm
6ad2e407eb
scripts: style: Sort more kinds of package definitions.
* guix/scripts/style.scm (order-packages): Match comments before package
S-exp. and its fields.  Match in let.  Match package/inherit.
* tests/guix-style.sh: Add pkg-baz variable and package/inherit to test.

Change-Id: I48a5976930501c20415b5413966b5294958bc23b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09 18:20:41 +01:00
Herman Rimm
0950b726f2
scripts: style: Refactor order-packages.
* guix/scripts/style.scm (order-packages): Combine package-name and
package-version procedures into package-fields.
(format-whole-file): Do not sort copyright headers or module definition.

Change-Id: I5507bf8ed221f7017f972f0e0e64d149bea4854b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09 18:20:41 +01:00
Herman Rimm
6b55b971c8
import: crate: Comment out missing dependencies.
* guix/import/crate.scm (package-names->package-inputs): Emit comments.
(make-crate-sexp): Make input into comment if missing.
(crate->guix-package): Take #:mark-missing? argument.
[dependency-name+missing+version+yanked]: Mark as missing.  Rename from
dependency-name+version+yanked.
[sort-map-dependencies]: Adjust.
[remove-missing+yanked-info]: Remove missing info.  Rename from
remove-yanked-info.
* guix/scripts/import/crate.scm (show-help): Explain --mark-missing.
(%options): Add mark-missing option.
(guix-import-crate): Pass mark-missing option as #:mark-missing?.
* doc/guix.texi (Invoking guix import): Document --mark-missing.
* tests/crate.scm ("crate->guix-package-marks-missing-packages"): Add
test.

Change-Id: I065d394e1c04fdc332b8f7f8b9fcbd87c14c6512
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09 18:20:41 +01:00
Herman Rimm
48c5942a1e
scripts: import: crate: show-help: Reformat.
* guix/scripts/import/crate.scm (show-help): Reformat and reword
--allow-yanked message.

Change-Id: I43a50b201be86cd71f6ab51a7161e4009d4918bf
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09 18:20:40 +01:00
Noé Lopez
1ec7bf9f29
pack: Support localstatedir in AppImage format.
* guix/scripts/pack.scm (self-contained-appimage): Support localstatedir
option.

Change-Id: I296b3d3e442aa90f36de62a9b23aba4a2c3de9a0
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-01-24 23:43:35 +01:00
Ludovic Courtès
0aa45f1854
home: Define ‘%base-home-services’.
* gnu/home.scm (%base-home-services): New variable.
(<home-environment>)[services]: Change default to ‘%base-home-services’.
* guix/scripts/home/import.scm (manifest+configuration-files->code): Use
‘%base-home-services’ by default.
* tests/home-import.scm (match-home-environment-no-services)
(match-home-environment-transformations)
(match-home-environment-no-services-nor-packages)
(match-home-environment-bash-service)
(match-home-environment-bash-service-with-alias): Adjust accordingly.
* doc/he-config-bare-bones.scm: Use ‘%base-home-services’.
* doc/guix.texi (Declaring the Home Environment): Add index entry for
‘%base-home-services’.

Change-Id: Id95ede62b97a976aad138bfc4b63fc0bdf37c7de
2025-01-16 22:32:11 +01:00
Ludovic Courtès
a6642650a7
reconfigure: Make ‘load-system-for-kexec’ errors non-fatal.
Partially fixes <https://issues.guix.gnu.org/75215>.

* guix/scripts/system/reconfigure.scm (load-system-for-kexec): Catch
exceptions in the gexp.  Report them outside.

Reported-by: Luis Guilherme Coelho <lgcoelho@disroot.org>
Change-Id: Iebcdc92e29b8623a55967d58a4f353abab01631a
2025-01-07 17:44:12 +01:00
Ludovic Courtès
d8b7259197
reconfigure: Do not pass KEXEC_FILE_DEBUG.
This flag is unsupported in Linux 6.6 and causes ‘kexec_file_load’ to
fail with EINVAL.

Fixes <https://issues.guix.gnu.org/75211>.

* guix/scripts/system/reconfigure.scm (kexec-loading-program): Remove
KEXEC_FILE_DEBUG.
* guix/build/syscalls.scm (KEXEC_FILE_DEBUG): Add comment.

Suggested-by: nathan <nathan_mail@nborghese.com>
Reported-by: Simen Endsjø <contact@simendsjo.me>
Change-Id: Ia48be7f4cfa9c6352908e4bea6472cd648f866ed
2025-01-07 17:44:12 +01:00
Ludovic Courtès
1305f78d05
reconfigure: Support loading the system for kexec reboot.
This allows rebooting straight into the new system with ‘reboot -k’.

* guix/scripts/system/reconfigure.scm (kexec-loading-program)
(load-system-for-kexec): New procedures.
* gnu/tests/reconfigure.scm (run-kexec-test): New procedure.
(%test-upgrade-kexec): New variable.
* guix/scripts/system.scm (perform-action): Add #:load-for-kexec?.
Call ‘load-system-for-kexec’.
(show-help, %options): Add ‘--no-kexec’.
(%default-options): Add ‘load-for-kexec?’.
(process-action): Honor it and pass it to ‘perform-action’.
* gnu/machine/ssh.scm (deploy-managed-host): Add call to
‘load-system-for-kexec’.
* doc/guix.texi (Invoking guix system): Document it.

Change-Id: I86d11f1c348e4359bc9e73c86e5aebff60fe875c
2024-12-28 22:47:34 +01:00
Ludovic Courtès
e16cdcf37d
time-machine: Add ‘--no-check-certificate’.
This can be tested with:

  guix shell libfaketime -- faketime 2019-01-01 \
    guix time-machine -q --no-check-certificate

* guix/scripts/time-machine.scm (%options, show-help): Add
‘--no-check-certificate’.
(%default-options): Add ‘verify-certificate?’ key.
(guix-time-machine): Honor it.

Change-Id: I25a29d03d4df78d1618c6a416ec85fd8e90fec6c
2024-12-25 23:51:10 +01:00
Ludovic Courtès
7d235a6799
pull: Add ‘--no-check-certificate’.
This can be tested with:

  guix shell libfaketime -- faketime 2019-01-01 \
    guix pull -q --no-check-certificate -p /tmp/p

* guix/scripts/pull.scm (%options, show-help): Add
‘--no-check-certificate’.
(%default-options): Add ‘verify-certificate?’ key.
(guix-pull): Honor it.
* doc/guix.texi (Invoking guix pull): Document it.

Change-Id: Ia9d7af1c64156b112e86027fb637e2e02dae6e3c
2024-12-25 23:51:10 +01:00
Ludovic Courtès
fc438ef675
guix download: Honor ‘--no-check-certificate’ for ‘--git’.
Until now ‘--no-check-certificate’ had no effect when combined with
‘--git’.  This can be tested with:

  guix shell libfaketime -- faketime 2019-01-01 \
    guix download --no-check-certificate --git \
    https://git.savannah.gnu.org/git/shepherd.git

* guix/scripts/download.scm (git-download-to-file): Add #:verify-certificate?
and honor it.
(git-download-to-store*): Likewise.
(add-git-download-option): Likewise.
(%options): Likewise.

Change-Id: Ib3905398199d814a02319ed3328eb8a4ed219bd5
2024-12-25 23:51:10 +01:00
Richard Sent
f1c2681542
deploy: Add ‘--expression’.
* guix/scripts/deploy.scm (show-help): Add help.
(%options): Add -e and --expression.
(guix-deploy): Use expression and check for invalid flag combinations.

Change-Id: I200c9ff0c9a8c686efff4a21cd33c10429f3c73e
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-23 20:45:32 +01:00
Richard Sent
5c54300b78
weather: Reword the help message for the expression flag.
* guix/scripts/weather.scm (show-help): Reword help.

Change-Id: I670dc0c8f89b81e2f7f8b5d7a9a05f74b3ac9cdd
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-23 20:45:32 +01:00