summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* scripts: system: Add support for container network sharing.Christopher Baines2018-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of the functionality in the Guix environment command to the guix system container command. This requires additional changes to the operating-system definitions used, in particular, networking related services may need removing if the host network is shared. * guix/scripts/system.scm (system-derivation-for-action): Add #:container-shared-network? argument. (perform-action): Add #:container-shared-network? argument. (show-help): Add "-N, --network" help information. (%options): Add network option. (process-action): Call perform-action with #:container-shared-network?. * gnu/system/linux-container.scm (%network-configuration-files): New variable. (container-script): Add support for returning a container script that shares the host network. * gnu/system.scm (essential-services): Add #:container-shared-network? argument. (operating-system-services): Add #:container-shared-network? argument. (operating-system-etc-service): Add #:container-shared-network? argument, and support for ommiting some configuration if the network is shared. (operating-system-activation-script): Add #:container-shared-network? argument, and pass this through to the operating-system-services procedure. (operating-system-boot-script): Add #:container-shared-network? argument, and pass this through to the operating-system-services procedure. (operating-system-derivation): Add the #:container-shared-network? argument, and pass this through to the operating-system-services procedure. (operating-system-profile): Add the #:container-shared-network? argument, and pass this through to the operating-system-services procedure.
* refresh: '--list-dependents' ignores deprecated packages.Ludovic Courtès2018-12-04
| | | | * guix/scripts/refresh.scm (all-packages): Filter out deprecated packages.
* build: Default to https://ci.guix.info for substitutes.Ludovic Courtès2018-12-04
| | | | | | | | | * config-daemon.ac (guix_substitute_urls): Always default to "https://ci.guix.info". * doc/guix.texi (SUBSTITUTE-SERVER): Switch to ci.guix.info. * guix/scripts/build.scm (%default-log-urls): Likewise. * guix/scripts/substitute.scm (%default-substitute-urls): Likewise. * guix/store.scm (%default-substitute-urls): Likewise.
* Remove most references to hydra.gnu.org.Ludovic Courtès2018-12-04
| | | | | | | | | | | | | | | * Makefile.am (assert-binaries-available): Don't mention hydra.gnu.org in comment. * build-aux/check-available-binaries.scm: Likewise. * build-aux/check-final-inputs-self-contained.scm: Likewise. * doc/guix.texi (SUBSTITUTE-SERVER): New variable. Use it throughout instead of "mirror.hydra.gnu.org". * doc/contributing.texi (Submitting Patches): Likewise. * gnu/services/base.scm (hydra-key-authorization) (guix-activation): Remove mentions of "hydra.gnu.org" in comments and messages. * gnu/system/install.scm (%installation-services): Likewise. * guix/scripts/size.scm (guix-size): Likewise.
* repl: Load user's initialization file.Oleg Pykhalov2018-12-03
| | | | * guix/scripts/repl.scm (guix-repl): Load user's initialization file.
* guix build: Add '--with-commit'.Ludovic Courtès2018-11-30
| | | | | | | | | | | | | | * guix/git.scm (<git-checkout>)[commit]: New field. (git-checkout-compiler): Honor it. * guix/scripts/build.scm (evaluate-git-replacement-specs): Add 'proc' parameter and honor it. (transform-package-source-branch)[replace]: New procedure. Adjust 'evaluate-git-replacement-specs' accordingly. (transform-package-source-commit): New procedure. (%transformations, %transformation-options) (show-transformation-options-help): Add 'with-commit'. * tests/guix-build-branch.sh: Add test. * doc/guix.texi (Package Transformation Options): Document it.
* guix build: Add '--with-branch' transformation option.Ludovic Courtès2018-11-30
| | | | | | | | | | * guix/scripts/build.scm (evaluate-git-replacement-specs) (transform-package-source-branch): New procedures. (%transformations, %transformation-options): Add 'with-branch'. (show-transformation-options-help): Likewise. * tests/guix-build-branch.sh: New file. * Makefile.am (SH_TESTS): Add it. * doc/guix.texi (Package Transformation Options): Document it.
* guix hash: Fix version and help messagesTim Gesthuizen2018-11-28
| | | | | | | | | | | ca719424455465fca4b872c371daf2a46de88b33 changes the name of the executable to be displayed by the --version and --help commands of `guix hash` to "gcrypt hash". This is reverted by this commit. * guix/scripts/hash.scm (show-help): Change string literals Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* pack: List the available formats.Efraim Flashner2018-11-27
| | | | | * guix/scripts/pack.scm (show-formats): New variable. (%options, show-help): Add 'list-formats' option.
* describe: Delete 'directory' argument from 'display-checkout-info'.Oleg Pykhalov2018-11-27
| | | | | | | This commit follows 1255400faabfcf0ca1666d17f2f34ea0d49f6b1f. * guix/scripts/describe.scm (display-checkout-info): Delete 'directory' argument.
* repl: Do not exit repl on SIGINT.Oleg Pykhalov2018-11-26
| | | | * guix/scripts/repl.scm (guix-repl): Do not exit repl on SIGINT.
* pack: Add '--profile-name'.Ludovic Courtès2018-11-23
| | | | | | | | | | | | * guix/scripts/pack.scm (self-contained-tarball): Add #:profile-name and honor it. (squashfs-image, docker-image): Add #:profile-name. (%default-options): Add 'profile-name'. (%options, show-help): Add "--profile-name". (guix-pack): Honor it. * tests/guix-pack-localstatedir.sh: New file. * Makefile.am (SH_TESTS): Add it. * doc/guix.texi (Invoking guix pack): Document "--profile-name".
* describe: Add recutils format.Oleg Pykhalov2018-11-22
| | | | | | | * guix/scripts/describe.scm (channel->recutils): New procedure. (display-checkout-info, display-profile-info): Use this. (%options): Add 'recutils' option. * doc/guix.texi (Invoking guix describe): Document this.
* describe: Add json format.Oleg Pykhalov2018-11-22
| | | | | | | * guix/scripts/describe.scm (channel->json): New procedure. (display-checkout-info, display-profile-info): Use this. (%options): Add 'json' option. * doc/guix.texi (Invoking guix describe): Document this.
* describe: Use a procedure to format output.Oleg Pykhalov2018-11-22
| | | | | * guix/scripts/describe.scm (channel->sexp): New procedure. (display-checkout-info, display-profile-info): Use this.
* guix system: Fix 'init' again.Ludovic Courtès2018-11-21
| | | | | | | | | Fixes a regression introduced in 52ee4479ef26826a53b9929cd00ca7738be687b1, whereby 'install' would now be passed a procedure instead of a lowerable object. * guix/scripts/system.scm (perform-action): Pass BOOTLOADER-SCRIPT as the #:bootloader-installer argument of 'install'.
* describe: Add profile option.Oleg Pykhalov2018-11-21
| | | | | | | * guix/scripts/describe.scm (%options): Add profile option. (show-help): Document this. (display-checkout-info): Check for profile argument. * doc/guix.texi (Invoking guix describe): Document this.
* describe: Fix 'format' option.Oleg Pykhalov2018-11-21
| | | | | | Fix ‘guix describe’ ignores ‘--format=FORMAT’ option. * guix/scripts/describe.scm (%options): Fix 'format' option.
* lint: 'check-derivation' fully disables grafts.Ludovic Courtès2018-11-20
| | | | | | | | Previously grafting could take place indirectly, for instance when lowering origins. * guix/scripts/lint.scm (check-derivation)[try]: Parameterize '%graft?'.
* lint: 'check-derivation' tries all the package's supported systems.Ludovic Courtès2018-11-20
| | | | | | | | This allows us to catch architecture-specific evaluation failures. * guix/scripts/lint.scm (check-derivation): Move body into... [try]: ... this. New procedure. Call 'try' for each supported system of PACKAGE.
* guix system: Fix 'init'.Ludovic Courtès2018-11-19
| | | | | | | | Fixes a regression introduced in 52ee4479ef26826a53b9929cd00ca7738be687b1, whereby 'install' would now be passed a <computed-file> object instead of a derivation. * guix/scripts/system.scm (install): Call 'lower-object' on BOOTCFG.
* guix system: Clarify 'perform-action'.Ludovic Courtès2018-11-18
| | | | | * guix/scripts/system.scm (perform-action): Move non-monadic local variables outside the 'mlet' form.
* guix system: De-monadify bootloader installation script.Ludovic Courtès2018-11-18
| | | | | | | | | * guix/scripts/system.scm (bootloader-installer-derivation): Rename to... (bootloader-installer-script): ... this. Use 'scheme-file' instead of 'gexp->file'. (perform-action): Adjust accordingly. Move 'lower-object' call to the point where DRVS is computed.
* guix system: Simplify bootloader package handling.Ludovic Courtès2018-11-18
| | | | | | | * guix/scripts/system.scm (perform-action): Remove 'bootloader-package' variable. Pass (bootloader-package bootloader) as the 2nd argument to 'bootloader-installer-derivation'. Remove BOOTLOADER-PACKAGE from DRVS since it's redundant.
* system: De-monadify 'operating-system-bootcfg'.Ludovic Courtès2018-11-18
| | | | | | | | | * gnu/system.scm (operating-system-bootcfg): Remove 'mlet*' and 'lower-object' call. * gnu/system/vm.scm (system-disk-image) (system-qemu-image/shared-store): Adjust accordingly. * guix/scripts/system.scm (perform-action): Add 'lower-object' call for BOOTCFG.
* guix system: Invoking 'guix system init' twice keeps timestamps zeroed.Ludovic Courtès2018-11-11
| | | | | | | | | | | | | | Fixes a bug whereby running 'guix system init config.scm /mnt' twice would, on the second run, change timestamps in /mnt/gnu/store from the Epoch to now. This is because the 'register-path' call would bypass the 'reset-timestamps' phase altogether in that case, as a consequence of commit bb3b6ccb05550fbfbeb459c68819a752327d6e1e. Reported by Christopher Baines. * guix/scripts/system.scm (install): When TARGET/var/guix exists, delete it. As a side-effect, this ensures that later on, the 'register-path' call invokes 'reset-timestamps' on all the copied store items.
* guix package: '--show' errors when asked for a non-existent package.Ludovic Courtès2018-11-11
| | | | | | | | | Fixes <https://bugs.gnu.org/33323>. Reported by swedebugia <swedebugia@riseup.net>. * guix/scripts/package.scm (process-query): Call 'leave' when 'find-packages-by-name' returns the empty list. * tests/guix-package.sh: Test it.
* pull: Add missing monadic 'return'.Ludovic Courtès2018-11-07
| | | | | | | | | | | | | | | | | | | | | | | Fixes a regression introduced in 5f7dd092ca577a534067f577b8849ed06cabf970 where, upon completion, 'guix pull' would fail (instead of printing the new/upgraded packages) with ugly errors like: successfully built /gnu/store/…-profile.drv 1 package in profile Backtrace: […] In guix/store.scm: 1605:24 1 (run-with-store _ _ #:guile-for-build _ #:system _ # _) In unknown file: 0 (_ #<build-daemon 256.97 2476b40>) ERROR: Wrong type to apply: #t Reported by thorwil on #guix. * guix/scripts/pull.scm (build-and-install): Add missing 'return' when DRY-RUN? is wrong.
* pack: Squashfs backend now honors '--localstatedir'.Ludovic Courtès2018-11-06
| | | | | | | | * guix/scripts/pack.scm (squashfs-image)[database]: New variable. [build]: Add (gnu build install) to the closure. Call 'install-database-and-gc-roots' when DATABASE is true, and invoke mksquashfs once more. * tests/pack.scm ("squashfs-image + localstatedir"): New test.
* pack: Docker backend now honors '--localstatedir'.Ludovic Courtès2018-11-06
| | | | | | | | | | * guix/docker.scm (build-docker-image): Add #:database parameter. Create /var/guix/db, /var/guix/profiles, etc. when DATABASE is true. * guix/scripts/pack.scm (docker-image): Export. Remove #:deduplicate? parameter. Define 'database' and pass it to 'docker-image'. * tests/pack.scm (test-assertm): Recompile the derivation of %BOOTSTRAP-GUILE. ("docker-image + localstatedir"): New test.
* pack: Import (guix store database) only when '--localstatedir' is passed.Ludovic Courtès2018-11-06
| | | | | | | | | | | | | This is another way to address <https://bugs.gnu.org/32184>, which was previously addressed in commit 19c924af4f3726688ca155a905ebf1cb9acdfca2. * gnu/build/install.scm (register-closure): Move to... * gnu/build/vm.scm (register-closure): ... here. New procedure. * guix/scripts/pack.scm (self-contained-tarball)[build]: Remove now unneeded 'with-extensions' form and custom (guix config) module. * tests/guix-pack.sh: Revert the strategy from commit 19c924af4f3726688ca155a905ebf1cb9acdfca2. * tests/pack.scm ("self-contained-tarball"): Likewise.
* pack: Move store database creation to a separate derivation.Ludovic Courtès2018-11-06
| | | | | | | | | | | | | * guix/scripts/pack.scm (store-database): New procedure. (self-contained-tarball): Use it when LOCALSTATEDIR? is true. Remove 'schema' and add 'database'. [build]: Pass DATABASE to 'populate-single-profile-directory'. (squashfs-image): Remove #:deduplicate? parameter. [build]: Remove (gnu build install) and (guix config) from the imported modules. Remove 'with-extensions'. * gnu/build/install.scm (populate-single-profile-directory): Remove #:deduplicate?, #:register?, and #:schema; add #:database. Remove call to 'register-closure' and simply copy DATABASE instead.
* pull: Make '--dry-run' behave as expected.Ludovic Courtès2018-11-06
| | | | | | | | | * guix/scripts/pull.scm (show-help): Document '--dry-run'. (build-and-install): Add #:dry-run? parameter and honor it. (guix-pull): Remove (assoc-ref opts 'dry-run?) condition. Instead, pass it as #:dry-run? to 'build-and-install'. * doc/guix.texi (Invoking guix pull): Document '--dry-run'. Move '--verbose' to the bottom.
* Add 'guix processes'.Ludovic Courtès2018-10-29
| | | | | | | | | * guix/scripts/processes.scm, tests/processes.scm: New files. * Makefile.am (MODULES): Add the former. (SCM_TESTS): Add the latter. * po/guix/POTFILES.in: Add guix/scripts/processes.scm. * doc/guix.texi (Invoking guix processes): New node. (Invoking guix-daemon): Reference it.
* pack: Hide 'zip' colliding binding.Ludovic Courtès2018-10-27
| | | | * guix/scripts/pack.scm: Hide 'zip' from (gnu packages compression).
* pack: Remove unused variable.Ludovic Courtès2018-10-27
| | | | * guix/scripts/pack.scm (self-contained-tarball)[libgcrypt]: Remove.
* scripts: Suggest running 'guix gc' when we're short on disk space.Ludovic Courtès2018-10-23
| | | | | | | * guix/scripts.scm (%disk-space-warning): New variable. (warn-about-disk-space): New procedure. * guix/scripts/package.scm (build-and-use-profile): Use it. * guix/scripts/system.scm (process-action): Likewise.
* pack: Fix "-C none -f tarball".Ludovic Courtès2018-10-19
| | | | | | | | | | | | | Fixes a regression introduced in 48b444304e206c35cf2c8e0d87a4711f1aac4fd4 whereby "guix pack -C none hello" would fail with: ERROR: In procedure string-join: In procedure string-join: Wrong type argument in position 1: #f builder for `/gnu/store/…-tarball-pack.tar.drv' failed with exit code 1 * guix/scripts/pack.scm (self-contained-tarball): Adjust for when 'compressor-command' returns #f.
* import cran: Document "recursive" option.Pierre Neidhardt2018-10-17
| | | | * guix/scripts/import/cran.scm: (show-help): Document "recursive" option.
* status: Build upon multiplexed build output.Ludovic Courtès2018-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for more accurate status tracking and parsing of extended build traces. * guix/status.scm (multiplexed-output-supported?): New procedure. (print-build-event): Don't print \r when PRINT-LOG? is true. Adjust 'build-log' handling for when 'multiplexed-output-supported?' returns true. (bytevector-index, split-lines): New procedures. (build-event-output-port)[%build-output-pid, %build-output] [%build-output-left]: New variables. [process-line]: Handle "@ build-output" traces. [process-build-output]: New procedure. [write!]: Add case for when %BUILD-OUTPUT-PID is true. Use 'bytevector-index' rather than 'string-index'. (compute-status): Add #:derivation-path->output-path. Use it. * tests/status.scm ("compute-status, multiplexed build output"): New test. ("build-output-port, UTF-8") ("current-build-output-port, UTF-8 + garbage"): Adjust to new 'build-log' output. * guix/scripts/build.scm (set-build-options-from-command-line): Pass #:multiplexed-build-output?. (%default-options): Add 'multiplexed-build-output?'. * guix/scripts/environment.scm (%default-options): Likewise. * guix/scripts/pack.scm (%default-options): Likewise. * guix/scripts/package.scm (%default-options): Likewise. * guix/scripts/pull.scm (%default-options): Likewise. * guix/scripts/system.scm (%default-options): Likewise.
* describe: Canonicalize the profile.Ludovic Courtès2018-10-14
| | | | | | | | Fixes a regression introduced in 795d430d90e41eb172315bfccf79c9f13fc0ebfa whereby 'guix describe' would no longer display the generation number of ~/.config/guix/current. * guix/scripts/describe.scm (guix-describe): Call 'canonicalize-profile'.
* pull: Fix target of /var/guix/profiles/per-user/USER/current-guix.Ludovic Courtès2018-10-12
| | | | | | | | This is a followup to 8155a209071f981fbf359975f463be4bcf8fa23e. * guix/scripts/pull.scm (migrate-generations): Compute the right target for /var/guix/profiles/per-user/USER/current-guix. Previously we'd return "current-N-link" instead of "current-guix-N-link'.
* pull: Don't use rename(2) across potentially different devices.Ludovic Courtès2018-10-12
| | | | | | | | Reported by Formbi on #guix. * guix/scripts/pull.scm (migrate-generations): Use 'symlink' and 'delete-file' instead of 'rename-file'. The latter could lead to EXDEV when $HOME and /var were different partitions.
* pull: Create /var/guix/profiles/per-user/USER/current-guix.Ludovic Courtès2018-10-12
| | | | | | | | Previously the migration code would fail to create that file, so ~/.config/guix/current would be dangling. * guix/scripts/pull.scm (migrate-generations): Create /var/guix/profiles/per-user/USER/current-guix.
* pull: Turn ~/.config/guix/current into a symlink to /var/guix/profiles.Ludovic Courtès2018-10-11
| | | | | | | | | | | | | | | | | This is more consistent with what 'guix package' does, more pleasant for users (we no longer clobber ~/.config/guix), and more cluster-friendly (since /var/guix/profiles is usually an NFS share already.) * guix/scripts/pull.scm (%current-profile, %user-profile-directory): New variables. (migrate-generations, ensure-default-profile): New procedures. (guix-pull): Use %CURRENT-PROFILE by default. Call 'ensure-default-profile'. * doc/guix.texi (Invoking guix pull): Adjust 'guix package -p ~/.config/guix/current' example. * guix/scripts.scm (warn-about-old-distro): Check %PROFILE-DIRECTORY "/current-guix".
* profiles: Add 'ensure-profile-directory'.Ludovic Courtès2018-10-11
| | | | | | | | * guix/scripts/package.scm (ensure-default-profile): Move /var/guix/profiles/per-user handling to... * guix/profiles.scm (ensure-profile-directory): ... here. New procedure. * po/guix/POTFILES.in: Add 'guix/profiles.scm'.
* guix build: '-f' accepts file-like objects.Ludovic Courtès2018-10-09
| | | | | | | | * guix/scripts/build.scm (options->things-to-build)[validate-type]: Check for 'file-like?'. (options->derivations): Accept 'file-like?'. * tests/guix-build.sh: Add a test with 'computed-file'. * doc/guix.texi (Additional Build Options): Mention file-like objects.
* pull: '-l' now honors '-p'.Ludovic Courtès2018-10-09
| | | | | | * guix/scripts/pull.scm (process-query): Add 'profile' parameter and remove 'profile' local variable. (guix-pull): Adjust caller.
* perform-download: Optionally report a "download-progress" trace.Ludovic Courtès2018-09-27
| | | | | | | | | | | | * guix/scripts/perform-download.scm (perform-download): Add #:print-build-trace? and pass it to 'url-fetch'. (guix-perform-download): Define 'print-build-trace?' and pass it to 'perform-download'. * guix/build/download.scm (ftp-fetch): Add #:print-build-trace? and honor it. (url-fetch): Likewise. * nix/libstore/builtins.cc (builtinDownload): Set _NIX_OPTIONS environment variable.
* Add (guix status) and use it for pretty colored output.Ludovic Courtès2018-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/progress.scm (progress-reporter/trace): New procedure. (%progress-interval): New variable. (progress-reporter/file): Use it. * guix/scripts/build.scm (set-build-options-from-command-line): Pass #:print-extended-build-trace?. (%default-options): Add 'print-extended-build-trace?'. (guix-build): Parameterize CURRENT-TERMINAL-COLUMNS. Use 'build-status-updater'. * guix/scripts/environment.scm (%default-options): Add 'print-extended-build-trace?'. (guix-environment): Wrap body in 'with-status-report'. * guix/scripts/pack.scm (%default-options): Add 'print-build-trace?' and 'print-extended-build-trace?'. (guix-pack): Wrap body in 'with-status-report'. * guix/scripts/package.scm (%default-options, guix-package): Likewise. * guix/scripts/system.scm (%default-options, guix-system): Likewise. * guix/scripts/pull.scm (%default-options, guix-pull): Likewise. * guix/scripts/substitute.scm (progress-report-port): Don't call STOP when TOTAL is zero. (process-substitution): Add #:print-build-trace? and honor it. (guix-substitute)[print-build-trace?]: New variable. Pass #:print-build-trace? to 'process-substitution'. * guix/status.scm: New file. * guix/store.scm (set-build-options): Add #:print-extended-build-trace?; pass it into PAIRS. (%protocol-version): Bump. (protocol-version, nix-server-version): New procedures. (current-store-protocol-version): New variable. (with-store, build-things): Parameterize it. * guix/ui.scm (build-output-port): Remove. (colorize-string): Export. * po/guix/POTFILES.in: Add guix/status.scm. * tests/status.scm: New file. * Makefile.am (SCM_TESTS): Add it. * nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x162. * nix/libstore/build.cc (DerivationGoal::registerOutputs) (SubstitutionGoal::finished): Print a "@ hash-mismatch" trace before throwing.