From 3b1a12c5bff5a0c108284d19a6982bdf663bbceb Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 15 Nov 2021 16:38:05 +0000 Subject: import: Replace texlive importer. * guix/import/texlive.scm (fetch-sxml, sxml->package): Remove procedures. (tlpdb-file, tlpdb, files->directories, tlpdb->package): New procedures. (string->license): Add case for lpplgpl license combination. (guix-name): Remove COMPONENT argument. (texlive->guix-package): Use new procedures. (texlive-recursive-import): New procedure. * guix/scripts/import/texlive.scm (show-help, %options): Remove --archive option. (guix-import-texlive): Adjust call of texlive->guix-package. * doc/guix.texi (Invoking guix import): Update documentation. --- guix/scripts/import/texlive.scm | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/import/texlive.scm b/guix/scripts/import/texlive.scm index 6f0818e274..4aeaa79eef 100644 --- a/guix/scripts/import/texlive.scm +++ b/guix/scripts/import/texlive.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017 Ricardo Wurmus +;;; Copyright © 2017, 2021 Ricardo Wurmus ;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. @@ -42,8 +42,6 @@ (define %default-options (define (show-help) (display (G_ "Usage: guix import texlive PACKAGE-NAME Import and convert the Texlive package for PACKAGE-NAME.\n")) - (display (G_ " - -a, --archive=ARCHIVE specify the archive repository")) (display (G_ " -h, --help display this help and exit")) (display (G_ " @@ -60,10 +58,6 @@ (define %options (option '(#\V "version") #f #f (lambda args (show-version-and-exit "guix import texlive"))) - (option '(#\a "archive") #t #f - (lambda (opt name arg result) - (alist-cons 'component arg - (alist-delete 'component result)))) %standard-import-options)) @@ -84,13 +78,11 @@ (define (parse-options) (_ #f)) (reverse opts)))) (match args - ((package-name) - (let ((sexp (texlive->guix-package package-name - (or (assoc-ref opts 'component) - "latex")))) + ((name) + (let ((sexp (texlive->guix-package name))) (unless sexp (leave (G_ "failed to download description for package '~a'~%") - package-name)) + name)) sexp)) (() (leave (G_ "too few arguments~%"))) -- cgit v1.2.3 From f5fc395ab4cc79d52a4e316b907e780a5a7adb30 Mon Sep 17 00:00:00 2001 From: Xinglu Chen Date: Sun, 7 Nov 2021 12:13:32 +0100 Subject: scripts: home: Make ‘guix home import’ write home-configuration.scm. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/home.scm (process-command): Populate ‘home-configuration.scm’ in the destination directory instead of printing to stdout. * doc/guix.texi (Declaring the Home Environment): Adjust accordingly. (Invoking guix home): Likewise. Suggested-by: Ludovic Courtès Co-authored-by: Ludovic Courtès --- doc/guix.texi | 34 +++++++--------------------------- guix/scripts/home.scm | 10 +++++++++- 2 files changed, 16 insertions(+), 28 deletions(-) (limited to 'guix/scripts') diff --git a/doc/guix.texi b/doc/guix.texi index 158261e373..59ceb4477a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35933,9 +35933,8 @@ The @command{guix home import} command reads some of the ``dot files'' such as @file{~/.bashrc} found in your home directory and copies them to the given directory, @file{~/src/guix-config} in this case; it also reads the contents of your profile, @file{~/.guix-profile}, and, based -on that, it outputs a Home configuration that resembles your current -configuration. You can dump that configuration to a file and you're -ready to go! +on that, it populates @file{~/src/guix-config/home-configuration.scm} +with a Home configuration that resembles your current configuration. A simple setup can include Bash and a custom text configuration, like in the example below. Don't be afraid to declare home environment parts, @@ -36667,33 +36666,14 @@ $ guix home list-generations 10d @item import Generate a @dfn{home environment} from the packages in the default profile and configuration files found in the user's home directory. The -configuration files will be copied to the specified directory. Note -that not every home service that exists is supported (@pxref{Home -Services}). +configuration files will be copied to the specified directory, and a +@file{home-configuration.scm} will be populated with the home +environment. Note that not every home service that exists is supported +(@pxref{Home Services}). @example $ guix home import ~/guix-config -;; This "home-environment" file can be passed to 'guix home reconfigure' -;; to reproduce the content of your profile. This is "symbolic": it only -;; specifies package names. To reproduce the exact same profile, you also -;; need to capture the channels being used, as returned by "guix describe". -;; See the "Replicating Guix" section in the manual. - -(use-modules - (gnu home) - (gnu packages) - (gnu home services shells)) - -(home-environment - (packages - (map specification->package - (list "glibc-locales" "nss-certs" "nss"))) - (services - (list (service - home-bash-service-type - (home-bash-configuration - (bashrc - (list (local-file "/home/charlie/guix-config/.bashrc")))))))) +guix home: '/home/alice/guix-config' populated with all the Home configuration files @end example @end table diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 3f48b98ed4..afc7d8b39c 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -274,7 +274,15 @@ (define-syntax-rule (with-store* store exp ...) (_ (leave (G_ "wrong number of arguments~%")))))) (unless (file-exists? destination) (mkdir-p destination)) - (import-manifest manifest destination (current-output-port)))) + (call-with-output-file + (string-append destination "/home-configuration.scm") + (cut import-manifest manifest destination <>)) + (info (G_ "'~a' populated with all the Home configuration files~%") + destination) + (display-hint (format #f (G_ "\ +Run @command{guix home reconfigure ~a/home-configuration.scm} to effectively +deploy the home environment described by these files.\n") + destination)))) ((describe) (match (generation-number %guix-home) (0 -- cgit v1.2.3 From 0632ea98b362e8a6551435c72a78a28cac92049f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 23 Nov 2021 10:16:36 +0100 Subject: guix graph: Show '-M' in '--help' output. * guix/scripts/graph.scm (show-help): Add -M shorthand. --- guix/scripts/graph.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix/scripts') diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index 439fae0b52..8943e87099 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -542,7 +542,7 @@ (define (show-help) (display (G_ " --list-types list the available graph types")) (display (G_ " - --max-depth=DEPTH limit to nodes within distance DEPTH")) + -M, --max-depth=DEPTH limit to nodes within distance DEPTH")) (display (G_ " --path display the shortest path between the given nodes")) (display (G_ " -- cgit v1.2.3