unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* How to have guile module available during sudo system reconfigure?
@ 2024-08-20 21:43 Tomas Volf
  2024-08-21  7:25 ` Marek Paśnikowski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tomas Volf @ 2024-08-20 21:43 UTC (permalink / raw)
  To: help-guix

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


Hello Guix,

I did run into an interesting (frustrating?) problem.  I created a
package that bundles few Guile modules of my making.  I installed it
into my home environment and wanted to use helpers from it in my system
configuration.  However I am not sure how to do that.

When I do

--8<---------------cut here---------------start------------->8---
guix system build some/config.scm
--8<---------------cut here---------------end--------------->8---

The system builds and everything is fine.

However when try to reconfigure the system using

--8<---------------cut here---------------start------------->8---
sudo guix system reconfigure some/config.scm
--8<---------------cut here---------------end--------------->8---

It fails with a very descriptive error of

--8<---------------cut here---------------start------------->8---
ice-9/eval.scm:142:16: In procedure compile-top-call:
error: system-add-luks: unbound variable
hint: Did you forget `(use-modules (wolfsnet systems))'?
--8<---------------cut here---------------end--------------->8---

I managed to track it down to module from my package not being
importable.  Since I have it in my home environment, all non-sudo
commands work, however when I add in the sudo to actually install the
new system it does not find it.

I am not sure what to do about this.  I have tried to install the
package into system, but that does not seem to have any effect.

-E flag to sudo was suggested on IRC, and that works, however
documentation does not use it so I am bit scared of various site
effects it could have.

Does anyone know how to approach this?

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to have guile module available during sudo system reconfigure?
  2024-08-20 21:43 How to have guile module available during sudo system reconfigure? Tomas Volf
@ 2024-08-21  7:25 ` Marek Paśnikowski
  2024-08-22 20:30 ` André Batista
  2024-08-23  0:14 ` Ian Eure
  2 siblings, 0 replies; 4+ messages in thread
From: Marek Paśnikowski @ 2024-08-21  7:25 UTC (permalink / raw)
  To: help-guix

Tomas Volf <~@wolfsden.cz> writes:

> I did run into an interesting (frustrating?) problem.  I created a
> package that bundles few Guile modules of my making.  I installed it
> into my home environment and wanted to use helpers from it in my system
> configuration.  However I am not sure how to do that.
>
> When I do
>
> guix system build some/config.scm
>
>
> The system builds and everything is fine.
>
> However when try to reconfigure the system using
>
> sudo guix system reconfigure some/config.scm
>

I have settled on a different reconfiguration method on my systems to
ensure usage of modules brought in by guix pull

sudo guix system reconfigure -e '(@ (systems akashi) operating-system*)

I hope this is enough to work around your issue.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to have guile module available during sudo system reconfigure?
  2024-08-20 21:43 How to have guile module available during sudo system reconfigure? Tomas Volf
  2024-08-21  7:25 ` Marek Paśnikowski
@ 2024-08-22 20:30 ` André Batista
  2024-08-23  0:14 ` Ian Eure
  2 siblings, 0 replies; 4+ messages in thread
From: André Batista @ 2024-08-22 20:30 UTC (permalink / raw)
  To: help-guix

Hi Tomas,

ter 20 ago 2024 às 23:43:33 (1724208213), ~@wolfsden.cz enviou:
> 
> Hello Guix,
> 
> I did run into an interesting (frustrating?) problem.  I created a
> package that bundles few Guile modules of my making.  I installed it
> into my home environment and wanted to use helpers from it in my system
> configuration.  However I am not sure how to do that.
> 
> When I do
> 
> --8<---------------cut here---------------start------------->8---
> guix system build some/config.scm
> --8<---------------cut here---------------end--------------->8---
> 
> The system builds and everything is fine.
> 
> However when try to reconfigure the system using
> 
> --8<---------------cut here---------------start------------->8---
> sudo guix system reconfigure some/config.scm
> --8<---------------cut here---------------end--------------->8---
> 
> It fails with a very descriptive error of
> 
> --8<---------------cut here---------------start------------->8---
> ice-9/eval.scm:142:16: In procedure compile-top-call:
> error: system-add-luks: unbound variable
> hint: Did you forget `(use-modules (wolfsnet systems))'?
> --8<---------------cut here---------------end--------------->8---
> 

I've never done that, but have you tried setting GUILE_LOAD_PATH?

$ sudo GUILE_LOAD_PATH="myguile/modules:$GUILE_LOAD_PATH" guix system reconfigure some/config.scm

Cheers,


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to have guile module available during sudo system reconfigure?
  2024-08-20 21:43 How to have guile module available during sudo system reconfigure? Tomas Volf
  2024-08-21  7:25 ` Marek Paśnikowski
  2024-08-22 20:30 ` André Batista
@ 2024-08-23  0:14 ` Ian Eure
  2 siblings, 0 replies; 4+ messages in thread
From: Ian Eure @ 2024-08-23  0:14 UTC (permalink / raw)
  To: Tomas Volf; +Cc: help-guix

Hi Tomas,

Tomas Volf <~@wolfsden.cz> writes:

> [[PGP Signed Part:Undecided]]
>
> Hello Guix,
>
> I did run into an interesting (frustrating?) problem.  I created 
> a
> package that bundles few Guile modules of my making.  I 
> installed it
> into my home environment and wanted to use helpers from it in my 
> system
> configuration.  However I am not sure how to do that.
>
> When I do
>
> guix system build some/config.scm
>
>
> The system builds and everything is fine.
>
> However when try to reconfigure the system using
>
> sudo guix system reconfigure some/config.scm
>
>
> It fails with a very descriptive error of
>
> ice-9/eval.scm:142:16: In procedure compile-top-call:
> error: system-add-luks: unbound variable
> hint: Did you forget `(use-modules (wolfsnet systems))'?
>
> I managed to track it down to module from my package not being
> importable.  Since I have it in my home environment, all 
> non-sudo
> commands work, however when I add in the sudo to actually 
> install the
> new system it does not find it.
>
> I am not sure what to do about this.  I have tried to install 
> the
> package into system, but that does not seem to have any effect.
>
> -E flag to sudo was suggested on IRC, and that works, however
> documentation does not use it so I am bit scared of various site
> effects it could have.
>
> Does anyone know how to approach this?
>

If you have a personal Guix channel, any Guile code in it gets 
added to your load path.  I use this to include helpers which ease 
both system and home configurations, ex. this code for helping 
with offloading builds[1], or home services to launch 
jellyfin-mpv-shim[2] when I log in.

Perhaps the same setup would work for you, too.

Thanks,

  — Ian

[1]: 
https://codeberg.org/ieure/atomized-guix/src/branch/main/atomized/system/offload.scm
[2]: 
https://codeberg.org/ieure/atomized-guix/src/branch/main/atomized/home/services/media.scm


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-23  0:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 21:43 How to have guile module available during sudo system reconfigure? Tomas Volf
2024-08-21  7:25 ` Marek Paśnikowski
2024-08-22 20:30 ` André Batista
2024-08-23  0:14 ` Ian Eure

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).