unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleg Pykhalov <go.wigust@gmail.com>
To: Andrew Tropin <andrew@trop.in>
Cc: 50296-done@debbugs.gnu.org
Subject: bug#50296: [PATCH 0/2] Add 'guix home' command.
Date: Tue, 31 Aug 2021 14:13:04 +0300	[thread overview]
Message-ID: <87tuj598an.fsf@gmail.com> (raw)
In-Reply-To: <874kb6j718.fsf@trop.in> (Andrew Tropin's message of "Tue, 31 Aug 2021 12:28:12 +0300")

[-- Attachment #1: Type: text/plain, Size: 8795 bytes --]

Hi Andrew,

Andrew Tropin <andrew@trop.in> writes:

> Command and subbcommands allowing to manage home environment with guix.
>
> Andrew Tropin (2):
>   scripts: Add 'guix home'.
>   scripts: home: Add import subcommand.
>
>  Makefile.am                  |   3 +
>  guix/scripts/home.scm        | 512 +++++++++++++++++++++++++++++++++++
>  guix/scripts/home/import.scm | 241 +++++++++++++++++
>  3 files changed, 756 insertions(+)
>  create mode 100644 guix/scripts/home.scm
>  create mode 100644 guix/scripts/home/import.scm

I applied your patches and also fixed a typo in
gnu/home-services/xdg.scm file, which I noticed during Geiser entering
(guix scripts home) module about missing ‘home-services-utils’, which
should be ‘home-services utils’.

Pushed to wip-guix-home.

Also, I tried to use guix home for the first time as documented at site
[1], and got an error:
--8<---------------cut here---------------start------------->8---
(string-append #f "/" "profile/share/fonts")
In procedure string-append: Wrong type (expecting string): #f
--8<---------------cut here---------------end--------------->8---

[1] https://guix-home.trop.in/Declaring-the-Home-Environment.html


The following text in the message is only about the error.

oleg@guixsd ~/src/guix-wip-guix-home$ mkdir /tmp/guix

oleg@guixsd ~/src/guix-wip-guix-home$ guix pull --url=file:///home/oleg/src/guix-wip-guix-home --branch=wip-guix-home -p /tmp/guix/guix

~/.local/share/chezmoi/dotfiles/guixsd/home.scm:
--8<---------------cut here---------------start------------->8---
(use-modules (gnu home)
	     (gnu home-services)
	     ;; (gnu home-services ssh)
	     (gnu home-services shells)
	     ;; (gnu home-services files)
	     (gnu services)
	     (gnu packages admin)
             (guix gexp)

             (ice-9 rdelim))

(define %home
  (and=> (getenv "HOME")
         (lambda (home)
           home)))

(define .bash_profile
  (string-append %home "/.local/share/chezmoi/dot_bash_profile"))

(home-environment

 ;; (packages (list htop))

 (services
  (list

   (service home-bash-service-type
            (home-bash-configuration
             (guix-defaults? #t)
             (bash-profile
              (list
               (with-input-from-file .bash_profile read-string)))))

   ;; XXX: missing home-files-service-type
   ;; (simple-service 'test-config
   ;;                 home-files-service-type
   ;;                 (list `("config/test.conf"
   ;;                         ,(plain-file "tmp-file.txt"
   ;;                                      "the content of ~/.config/test.conf"))))
   
   ;; XXX: missing home-ssh-configuration
   ;; (service home-ssh-service-type
   ;;          (home-ssh-configuration
   ;;           (extra-config
   ;;            (list
   ;;             (ssh-host "savannah"
   ;;      		 '((compression . #f)))))))

   )))
--8<---------------cut here---------------end--------------->8---

My first guix home reconfigure launch:
--8<---------------cut here---------------start------------->8---
oleg@guixsd ~/src/guix-wip-guix-home$ /tmp/guix/guix/bin/guix home reconfigure ~/.local/share/chezmoi/dotfiles/guixsd/home.scm
/gnu/store/xl4igqm0jjy7gfbganz9061ivdgzfpdk-home
New symlinks to home-environment will be created soon.
All conflicting files will go to /home/oleg/1630407324-guix-home-legacy-configs-backup.

Skipping   /home/oleg/.config (directory already exists)... done
Creating   /home/oleg/.config/fontconfig... done
Symlinking /home/oleg/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2iiqdhryfy7mqral0b9qz3hlva6-fonts.conf... done
Backing up /home/oleg/.bashrc... done
Symlinking /home/oleg/.bashrc -> /gnu/store/513j2xkszmcmv7fiawh59mr0i1fmin55-bashrc... done
Symlinking /home/oleg/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5jzq5-shell-profile... done
Backing up /home/oleg/.bash_profile... done
Symlinking /home/oleg/.bash_profile -> /gnu/store/2c3yva8vj5ikb0gspmjvzw0r9g9i1cxc-bash_profile... done
 done
Finished updating symlinks.

Backtrace:
In guix/ui.scm:
   2185:7 19 (run-guix . _)
  2148:10 18 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1752:10 17 (with-exception-handler _ _ #:unwind? _ # _)
In guix/status.scm:
    820:3 16 (_)
    800:4 15 (call-with-status-report _ _)
In guix/scripts/home.scm:
    214:4 14 (_)
In ice-9/boot-9.scm:
  1752:10 13 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   658:37 12 (thunk)
   1320:8 11 (call-with-build-handler _ _)
   1320:8 10 (call-with-build-handler #<procedure 7f5d757319c0 at g…> …)
  2108:24  9 (run-with-store #<store-connection 256.99 7f5d77fb3550> …)
In guix/scripts/home.scm:
   169:15  8 (_ _)
In unknown file:
           7 (primitive-load "/gnu/store/xl4igqm0jjy7gfbganz9061ivdg…")
In ice-9/eval.scm:
    619:8  6 (_ #(#(#(#(#(#(#(#(#(#(#<…> …) …) …) …) …) …) …) …) …) …))
   626:19  5 (_ #(#(#(#(#(#(#(#(#(#(#<…> …) …) …) …) …) …) …) …) …) …))
In srfi/srfi-1.scm:
   586:17  4 (map1 (("profile/share/fonts" (system* "/gnu/stor…" …))))
In ice-9/eval.scm:
   293:34  3 (_ #(#(#<directory (guile-user) 7f5d87ca3c80> #<va…>) #))
In unknown file:
           2 (string-append #f "/" "profile/share/fonts")
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure string-append: Wrong type (expecting string): #f
--8<---------------cut here---------------end--------------->8---

I skipped the error and tried to configure Bash more:
--8<---------------cut here---------------start------------->8---
(define .bashrc
  (string-append %home "/.local/share/chezmoi/dot_bashrc"))

;; ...

            (home-bash-configuration
             ;; ...
             (bashrc
              (list
               (with-input-from-file .bashrc read-string))))
--8<---------------cut here---------------end--------------->8---

Another launch, no errors this time:
--8<---------------cut here---------------start------------->8---
oleg@guixsd ~/src/guix-wip-guix-home$ /tmp/guix/guix/bin/guix home reconfigure ~/.local/share/chezmoi/dotfiles/guixsd/home.scm
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
The following derivations will be built:
   /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv
   /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv
   /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv
   /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv
building /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv...
successfully built /gnu/store/pm1gw2xakkqj0zxsbbq0jnwgv3v95ajj-provenance.drv
building /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv...
successfully built /gnu/store/xcvi7n1l0fvsm099x2vyg6xci0qkayzp-bashrc.drv
building /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv...
successfully built /gnu/store/akdwz30lx0widqvyqmnkya45cb78f74d-files.drv
building /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv...
successfully built /gnu/store/fn1hzpyic1k32pamyf45vwa0x3lw046g-home.drv
/gnu/store/1y84hzz1m1c3jw03n2g8hn9wwyxngab3-home
Cleaning up symlinks from previous home-environment.

Removing /home/oleg/.config/fontconfig/fonts.conf... done
Removing /home/oleg/.config/fontconfig... done
Skipping /home/oleg/.config (not an empty directory)... done
Removing /home/oleg/.bashrc... done
Removing /home/oleg/.profile... done
Removing /home/oleg/.bash_profile... done
Cleanup finished.

New symlinks to home-environment will be created soon.
All conflicting files will go to /home/oleg/1630407412-guix-home-legacy-configs-backup.

Skipping   /home/oleg/.config (directory already exists)... done
Creating   /home/oleg/.config/fontconfig... done
Symlinking /home/oleg/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2iiqdhryfy7mqral0b9qz3hlva6-fonts.conf... done
Symlinking /home/oleg/.bashrc -> /gnu/store/lf51wflmvx91m2jx8hx3j34qs9x1k153-bashrc... done
Symlinking /home/oleg/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5jzq5-shell-profile... done
Symlinking /home/oleg/.bash_profile -> /gnu/store/2c3yva8vj5ikb0gspmjvzw0r9g9i1cxc-bash_profile... done
 done
Finished updating symlinks.

Comparing /gnu/store/xl4igqm0jjy7gfbganz9061ivdgzfpdk-home/profile/share/fonts and
          /gnu/store/1y84hzz1m1c3jw03n2g8hn9wwyxngab3-home/profile/share/fonts... done (same)
Evaling on-change gexps.

On-change gexps evaluation finished.
--8<---------------cut here---------------end--------------->8---

Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  parent reply	other threads:[~2021-08-31 11:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  9:28 [bug#50296] [PATCH 0/2] Add 'guix home' command Andrew Tropin
     [not found] ` <handler.50296.B.16304022327647.ack@debbugs.gnu.org>
2021-08-31  9:40   ` [bug#50296] [PATCH 1/2] scripts: Add 'guix home' Andrew Tropin
2021-08-31 10:53     ` zimoun
2021-08-31 12:12       ` Andrew Tropin
2021-08-31 13:09         ` zimoun
2021-09-01  5:20           ` Andrew Tropin
2021-08-31  9:40   ` [bug#50296] [PATCH 2/2] scripts: home: Add import subcommand Andrew Tropin
2021-08-31 10:46 ` [bug#50296] [PATCH 0/2] Add 'guix home' command zimoun
2021-08-31 12:03   ` Andrew Tropin
2021-08-31 11:13 ` Oleg Pykhalov [this message]
2021-08-31 11:46   ` Andrew Tropin
2021-08-31 12:47     ` Andrew Tropin
2021-08-31 14:23       ` Oleg Pykhalov
2021-09-01  5:36         ` Andrew Tropin
2021-09-09  6:10         ` Andrew Tropin
2021-09-09 17:45           ` Oleg Pykhalov
2021-09-10  5:31             ` Andrew Tropin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tuj598an.fsf@gmail.com \
    --to=go.wigust@gmail.com \
    --cc=50296-done@debbugs.gnu.org \
    --cc=andrew@trop.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).