Re: Keyboard layout options not working

2023-12-07 Thread Hilton Chain
On Thu, 07 Dec 2023 20:28:02 +0800,
Lars Rustand wrote:
>
>
> Hilton Chain  writes:
> > In (gnu system keyboard), keyboard-layout is defined as:
> >
> > (keyboard-layout name (variant) (#:model) (#:options))
> >
> >
> > So the following should be used instead:
> >
> > (keyboard-layout "us" "no" #:options '("grp:switch"))
>
> I tried the above, but I get this following errror:
>
> -8<---cut here---start->8---
> error: (keyboard-layout "us" "no" #:options (quote ("grp:switch"))): invalid 
> field specifier
> -8<---cut here---end--->8---
>
> > And for X, xorg-configuration accepts a  record
> > and sets option XkbLayout to the name field of that record and
> > XkbVariant to variant (only when it's present).  Since XkbLayout
> > recognizes the comma syntax and variant is not set, the result is
> > valid.
>
> Well, this comma syntax is precisely what I am trying to use. Note
> that the "us,no" in my config refers to the list of US layout and NO
> layout, not a NO variant of the US layout (I don't think there is
> such a variant). The expected result of my keyboard-layout config is
> that I have US layout by default, and when I hold down the right alt
> key I get the NO layout.
>
> A similar configuration is shown in the examples under the Keyboard
> Layout section in the Guix manual.
>
> -8<---cut here---start->8---
> ;; Arabic layout with "Alt-Shift" to switch to US layout.
> (keyboard-layout "ar,us" #:options '("grp:alt_shift_toggle"))
> -8<---cut here---end--->8---


I didn't check setxkbmap when sending the mail, actually its syntax is
the same of ckbcomp.  So you don't have to change the procedure call,
sorry for my misinterpretation.

The keyboard-layout field of operating-system is solely for console
use (used by GRUB, and later loaded via loadkeys when booting).  So
you'll have to pass a  record to the keyboard-layout
field of your xorg-configuration.



Re: Keyboard layout options not working

2023-12-07 Thread Hilton Chain
Hi Efraim and Lars,
On Thu, 07 Dec 2023 18:28:53 +0800,
Efraim Flashner wrote:
>
> On Thu, Dec 07, 2023 at 10:48:11AM +0100, Lars Rustand wrote:
> > Hello, I'm trying to set the keyboard-layout options in my system config. I
> > have set the following:
> >
> > -8<---cut here---start->8---
> > (keyboard-layout (keyboard-layout "us,no" #:options '("grp:switch")))
> > -8<---cut here---end--->8---


In (gnu system keyboard), keyboard-layout is defined as:
--8<---cut here---start->8---
(keyboard-layout name (variant) (#:model) (#:options))
--8<---cut here---end--->8---

So the following should be used instead:
--8<---cut here---start->8---
(keyboard-layout "us" "no" #:options '("grp:switch"))
--8<---cut here---end--->8---


For TTY usage, the  record is used to create a console keymap
via ckbcomp, which has a different syntax from setxkbmap and requires a space
between layout and variant.


> > The above seems to have no effect. However, the same option works fine
> > when used with setxkbmap like this:
> >
> > -8<---cut here---start->8---
> > setxkbmap us,no -option 'grp:switch'
> > -8<---cut here---end--->8---
> >
> > It also works fine if set in `/etc/X11/xorg.conf.d/00-keyboard.conf`
> > like this:
> >
> > -8<---cut here---start->8---
> > Section "InputClass"
> > Identifier "system-keyboard"
> > MatchIsKeyboard "on"
> > Option "XkbLayout" "us,no"
> > Option "XkbOptions" "grp:switch"
> > EndSection
> > -8<---cut here---end--->8---
>
> I wouldn't mind getting the answer to this too.
>
> I have my keyboard config set in my os-config and also in my
> sway-config.  IIRC the keyboard-layout works really well in a TTY but
> not always as well on the desktop.


And for X, xorg-configuration accepts a  record and sets option
XkbLayout to the name field of that record and XkbVariant to variant (only when
it's present).  Since XkbLayout recognizes the comma syntax and variant is not
set, the result is valid.

So support for  is really environment-specific... But for sway
there's a procedure in rde[1] to create an input configuration as an alist, I
think it can be adapted to create a string as well (I personally use a
mixed-text-file for my sway config[2]).


Thanks
---
[1]: https://git.sr.ht/~abcdw/rde/tree/master/item/src/rde/features/wm.scm#L94
[2]: https://github.com/rakino/Testament/blob/trunk/dorphine-home.scm#L129



Re: Recursive substitute-keyword-arguments / setting default on build system

2023-09-27 Thread Hilton Chain
Hi Nils,

On Tue, 26 Sep 2023 19:08:06 +0800,
nils@landt.email wrote:
>
> Hello,
>
> I use a slightly customized emacs package, and want to use it as the package 
> that is used in emacs-build-system for the emacs plugins I'm using.
> The default emacs gets garbage collected and takes quite a while to 
> reinstall, I would like to avoid that. Also, it seems cleaner to build the 
> plugins with the exact version that they will be used with.
>
> Here's what I have:
>
> (define emacs-package
>   ((const
>  ((options->transformation
> '((with-configure-flag . 
> "emacs=--program-transform-name='s/^ctags$/ctags.emacs/'")))
>   emacs
>
> (define (set-build-system-emacs plugin-package)
>   (package
> (inherit plugin-package)
> (arguments
>   (substitute-keyword-arguments (package-arguments plugin-package)
> ((#:emacs emacs) `,emacs-package)
>
> (map set-build-system-emacs package-list)
>
> From what I can tell this does work for the packages in package-list, but not 
> for any inputs to those packages. That makes total sense to me, but I don't 
> know how to solve it.
> Any pointers? Or is it possible to set the default package for a build 
> system, removing the need for this mapping altogether?

`package-input-rewriting' (documented in [1]) can be used for the
purpose:

--8<---cut here---start->8---
(map (package-input-rewriting
  `((,emacs-minimal . ,emacs-package)
(,emacs . ,emacs-package)))
 package-list)
--8<---cut here---end--->8---

Thanks
---
[1]: 
https://guix.gnu.org/en/manual/devel/en/html_node/Defining-Package-Variants.html



Re: Problem with Shepherd after `guix home reconfigure`

2023-08-25 Thread Hilton Chain
Hello,

On Fri, 25 Aug 2023 14:59:03 +0800,
Tanguy LE CARROUR wrote:
>
> Hi,
>
> Quoting nils@landt.email (2023-08-23 10:09:06)
> > Tanguy LE CARROUR  hat am 22.08.2023 18:56 CEST 
> > geschrieben:
> > > I now have a slightly different error message:
> > >
> > > ```
> > > $ guix home reconfigure
> > > # […]
> > > SSLoading /gnu/store/zbfyaxxigns5lqyxhxzxhm92w54ns1cz-shepherd.conf.
> > > herd: error: exception caught while executing 'load' on service 'root':
> > > In procedure fport_write: Broken pipe
> > > ```
> > > […]
> > > Even though `mpd` is reported as "starting" it actually works.
> > > `herd stop mcron` still hangs forever, but `herd status` keeps on
> > > working and reporting "starting" services.
> > >
> > > Thoughts? 樂
> >
> > I had a similar issue about 2 months ago. I was using XDG_LOG_HOME in
> > a shepherd service definition, and it was not available anymore.
> > The error message I got was different, but the result was the same -
> > some services shown as "starting" and working, but herd  not
> > working for one particular broken service.
> >
> > I suggest to check your
> > /gnu/store/zbfyaxxigns5lqyxhxzxhm92w54ns1cz-shepherd.conf file for the
> > log path of the mcron job. Maybe your XDG_STATE_HOME points to a
> > non-writable directory?
>
> ```
> $ cat /gnu/store/l1463gh71pm62404rxpwbzhwmz8dakl2-shepherd-mcron.scm
> # […]
> #:log-file (string-append %user-log-dir "/mcron.log")
>
> $ env | grep XDG
> # […]
> XDG_STATE_HOME=/home/tanguy/.local/state
>
> $ ls /home/tanguy/.local/state
> log  nvim  shepherd  wireplumber
>
> $ ls /home/tanguy/.local/state/log/
> dbus.log  mcron.log  shepherd.log
> ```
>
> I have no XDG "log" variable, but the `shepherd.log` in `~/.local/state/log/`
> contains today's log, so… I guess it can write to the log folder.
> The strange thing is that today mcron's log is in
> `~/.local/state/shepherd/`?! 樂


From the definition in (shepherd support), the location is expected:
--8<---cut here---start->8---
(define %user-log-dir
  ;; Default log directory if shepherd is run as a normal user.
  (string-append (or (getenv "XDG_STATE_HOME")
 (string-append user-homedir "/.local/state"))
 "/shepherd"))
--8<---cut here---end--->8---


And ~/.local/state/log/mcron.log was used before changing to
%user-log-dir:
--8<---cut here---start->8---
#:log-file (string-append
(or (getenv "XDG_STATE_HOME")
(format #f "~a/.local/state"
(getenv "HOME")))
"/log/mcron.log")
--8<---cut here---end--->8---



Re: Problem with Shepherd after `guix home reconfigure`

2023-08-22 Thread Hilton Chain
Hi Tanguy,

On Wed, 23 Aug 2023 00:56:41 +0800,
Tanguy LE CARROUR wrote:
>
[...]
> > > ```
> > > $ guix home reconfigure
> > > # […]
> > > Loading /gnu/store/zbfyaxxigns5lqyxhxzxhm92w54ns1cz-shepherd.conf.
> > > herd: error: exception caught while executing 'load' on service 'root':
> > > In procedure fport_write: Input/output error
> > > ```
> > >
> > > I've just tried something that, as weird as it sounds, I had never done 
> > > before:
> > > `herd stop mcron`! And… it just hangs forever!? I guess it not the
> > > expected behaviour?! 樂
> > > I `ctrl+c`-ed it and, now, `herd status` also hangs forever!? 
> > > I'll see if everything goes back to normal after the next reboot…
> >
> > I don't know much about Shepherd but rebooting seems to be the only
> > solution when it hangs...
>
> I now have a slightly different error message:
>
> ```
> $ guix home reconfigure
> # […]
> SSLoading /gnu/store/zbfyaxxigns5lqyxhxzxhm92w54ns1cz-shepherd.conf.
> herd: error: exception caught while executing 'load' on service 'root':
> In procedure fport_write: Broken pipe
> ```


Seems to be an issue in Shepherd itself, it hung during loading the
configuration.


> ```
> # herd status
> Started:
>  + root
> Starting:
>  ^ mcron
>  ^ mpd
> Stopped:
>  - tor
>  - transmission
> ```
>
> I usually have:
>
> ```
> # herd status
> Started:
>  + mcron
>  + mpd
>  + root
> Stopped:
>  - tor
>  - transmission
> ```
>
> Even though `mpd` is reported as "starting" it actually works.
> `herd stop mcron` still hangs forever, but `herd status` keeps on
> working and reporting "starting" services.
>
> Thoughts? 樂


From my own experience, such issue can be "solved" by rebooting (to
spawn new Shepherd daemons).  I don't know how to debug Shepherd and
there's no enough information for me to find the real cause.

So maybe sending a Shepherd bug report to bug-g...@gnu.org ?

Thanks



Re: Problem with Shepherd after `guix home reconfigure`

2023-08-22 Thread Hilton Chain
On Tue, 22 Aug 2023 21:51:07 +0800,
Tanguy LE CARROUR wrote:
>
> Hi Hilton,
>
> First of, I have to apologize to Shep[H]erd for the typo! Srry! 
> I've just fixed it in the subject.
>
>


No worry :)


> > Thank you for reporting the issue!
> >
> > This is caused by a missing module in mcron's service definition, and
> > now it should be fixed in 552d0703776c532f25498d5cb852c3c497cb9252.
> >
> > Please run `guix pull', then reconfigure the home environment.
>
> Much better! Thanks! 
>
> I still have an error message, though:


If you happen to use the system mcron service as well, please pull to
the latest commit again, my bad :(


> ```
> $ guix home reconfigure
> # […]
> Loading /gnu/store/zbfyaxxigns5lqyxhxzxhm92w54ns1cz-shepherd.conf.
> herd: error: exception caught while executing 'load' on service 'root':
> In procedure fport_write: Input/output error
> ```
>
> I've just tried something that, as weird as it sounds, I had never done 
> before:
> `herd stop mcron`! And… it just hangs forever!? I guess it not the
> expected behaviour?! 樂
> I `ctrl+c`-ed it and, now, `herd status` also hangs forever!? 
> I'll see if everything goes back to normal after the next reboot…


I don't know much about Shepherd but rebooting seems to be the only
solution when it hangs...



Re: Problem with Sheperd after `guix home reconfigure`

2023-08-22 Thread Hilton Chain
Hi Andreas,

On Tue, 22 Aug 2023 21:23:56 +0800,
Andreas Enge wrote:
>
> Hello,
>
> Am Tue, Aug 22, 2023 at 08:40:57PM +0800 schrieb Hilton Chain:
> > This is caused by a missing module in mcron's service definition, and
> > now it should be fixed in 552d0703776c532f25498d5cb852c3c497cb9252.
> > Please run `guix pull', then reconfigure the home environment.
>
> Now someone on IRC reports the converse problem:
>
> Did a recent commit broke guix ? I juste did guix pull but can 
> reconfigure the system anymore. Seems sheperd-mcron fails to build.
> *cannot
> Altadil: This sounds like a bug just was just repaired in the most 
> recent commit. Can you try to pull once more?
> andreas-e: still no luck. I am on 552d070, acording to guix describe
> Altadil: Sorry to hear this, then I do not know.
> andreas-e: that’s fine, thanks for your help
> Altadil: maybe it's that very commit that broke it, you could try 
> pulling from a commit earlier
> jpoiret: going back to one commit before worked, thanks !
>
> Could you maybe have another look?

Thank you for notifying me!!  The issue should be addressed in
0c4fb8f43f8aba2dcabe1bc97a8f6d8d41057704 now.



Re: Problem with Sheperd after `guix home reconfigure`

2023-08-22 Thread Hilton Chain
Hi Tanguy,

On Tue, 22 Aug 2023 18:33:05 +0800,
Tanguy LE CARROUR wrote:
>
> Hi Guix,
>
> This morning I `guix pull` and `guix system reconfigure` my system
> and everything seemed to be OK. But, when I `guix home reconfigure`,
> I got an error message:
>
> ```
> Loading /gnu/store/x103955zkwzkbmb9hji0dxc5fk7l8c3q-shepherd.conf.
> herd: error: exception caught while executing 'load' on service 'root':
> Unbound variable: %user-log-dir
> ```

Thank you for reporting the issue!

This is caused by a missing module in mcron's service definition, and
now it should be fixed in 552d0703776c532f25498d5cb852c3c497cb9252.

Please run `guix pull', then reconfigure the home environment.

Thanks



Re: guix pack: support for something similar to Nix's buildLayeredImage

2023-08-10 Thread Hilton Chain
Hi Simon,

On Wed, 09 Aug 2023 20:59:02 +0800,
Simon Pugnet wrote:
>
> I'm not a Guix or Nix expert but as far as I understand Nix solves
> this problem by using "pkgs.dockerTools.buildLayeredImage" (see
> http://ryantm.github.io/nixpkgs/builders/images/dockertools/#ssec-pkgs-dockerTools-buildLayeredImage)
> and "streamLayeredImage". In this example, this could in theory be
> used to build a coreutils-python image where coreutils exists in its
> own layer. That would mean that the coreutils-rust image could share
> the coreutils layer, saving space.
>
> Is there any way to achieve something similar in Guix? If not then are
> there any plans to support this functionality?

It's currently not available in Guix, but there's a patch series
 for it.

Thanks



Re: Newbie: How to edit a faulty package definition?

2023-06-25 Thread Hilton Chain
Hi Rodrigo,

On Sun, 25 Jun 2023 11:30:42 +0800,
Rodrigo Morales wrote:
...
>   | (define-module (my test-2)
...
>   | (define-public emacs-subed
>   |   (package
>   | (name "emacs-subed")
...
>   The main topic of this thread could have been: How to make "guix home"
>   give higher priority to a path specified through the `-L' flag? But I
>   decided not to ask for help on `guix home', because there are less
>   "guix home" users than Guix users, so I might need to wait
>   significantly more to get some help. I'd rather learn how to edit
>   package definitions and make `guix package -i' aware of that. I've
>   opened another thread on a question related to "guix edit" [here].

I have a solution but not about priorities.

The solution depends on how you add packages to your home environment.

If you are referencing them as variables, you can change the variable name of
your package, or directly referencing it with (@ (my test-2) emacs-subed).

If you are using the specification->package procedure, you can change the name
field of your package definition.



Re: patch question: any tool to download patches from guix patch mailing list?

2023-06-18 Thread Hilton Chain


You can try "View series on Patchwork" on qa.guix.gnu.org.