[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#54003: local-file after Guile update
From: |
Liliana Marie Prikler |
Subject: |
bug#54003: local-file after Guile update |
Date: |
Tue, 15 Feb 2022 09:21:54 +0100 |
User-agent: |
Evolution 3.42.1 |
Hi Aleksandr
Am Montag, dem 14.02.2022 um 21:50 +0000 schrieb Aleksandr Vityazev:
> Hi,
>
> I have the following dotfiles directory structure where I store my
> Guix home config:
>
> > -etc
> >
> > -subdir
> > |
> > |-home
>
>
> I often use the 'local-file' procedure in modules in the home
> directory. For example in /subdir/home/shells.scm:
>
> #+begin_src scheme :scheme guile :season guile
> (simple-service 'add-zsh-files
> home-files-service-type
> `(("config/zsh/zshrc"
> ,(local-file "../../etc/zsh/zshrc"))))
> #+end_src
> And it works, as expected.
Be careful when invoking Hyrum's Law. The meaning of this local-file
expression changes with the current working directory, which might be
different across invocations. To avoid such issues, you can (almost?)
always use (current-file-name), which you might want to canonicalize
for the operations you're about to do.
Taking (dirname) thrice then brings you to $GUIX_HOME_CONFIG_ROOT,
which contains both etc and subdir.
> The following example also worked before the
> 076e825dc5d585943ce820a279fffe4af09757fb (gnu: guile: Add version
> 3.0.8 as
> 'guile-3.0-latest') commit.
>
> in /subdir/home/wm.scm:
> #+begin_src scheme :scheme guile :season guile
> (service
> home-rofi-service-type
> (home-rofi-configuration
> (config-rasi
> `(,#~(format
> #f "@theme \"~a\""
> #$(local-file "../../etc/rofi/nord.rasi"))))))
> #+end_src
>
> After 076e825dc5d585943ce820a279fffe4af09757fb
> using (local-file "../../etc/rofi/nord.rasi") and not
> (local-file "etc/rofi/nord.rasi") causes an error:
>
> guix home: error: canonicalize-path: No such file or
> directory: "../../etc/rofi/nord.rasi".
>
> The example that causes the error uses the original Guix home
> implementation, which uses gexps. When I figure out how to make a
> minimal reproducer that does not depend on it, I will update this
> report.
I don't think this is an issue particularly in Guix Home, but for a MWE
you could try only writing a bashrc, which ought to work with upstream
as well. Use `guix home build` rather than `guix home reconfigure` so
as to not activate it.
Cheers
- bug#54003: local-file after Guile update, Aleksandr Vityazev, 2022/02/14
- bug#54003: local-file after Guile update,
Liliana Marie Prikler <=
- bug#54003: local-file after Guile update, Ludovic Courtès, 2022/02/15
- bug#54003: local-file after Guile update, Maxim Cournoyer, 2022/02/15
- bug#54003: local-file after Guile update, Ludovic Courtès, 2022/02/15
- bug#54003: local-file after Guile update, Maxime Devos, 2022/02/15
- bug#54003: local-file after Guile update, Ludovic Courtès, 2022/02/15
- bug#54003: local-file after Guile update, Ludovic Courtès, 2022/02/16
- bug#54003: local-file after Guile update, Ludovic Courtès, 2022/02/16