Re: set environment variables with guix shell [-m manifest.scm]

2022-05-06 Thread Kenny Ballou

On 2022-05-05 11:05 +02, zimoun wrote:
> Wed, 04 May 2022 at 18:53, Kenny Ballou  wrote:
>
>> However, one necessary feature of `guix shell` I'm not seeing: ability
>> to set arbitrary environment variables when `guix shell` loads.
>
> Yes, it misses an equivalent to ’nix-shell’ «shellHook» [1], as also
> reported by [2] Well, maybe you could achieve something via ’--file’
> instead of ’--manifest’, I do not know.

I was not aware of [2], thanks for pointing me to it.

I have not tried `--file`.  My understanding is that this does not quite
do the same thing.

Unrelated to search paths below, I had an idea that it would be possible
to construct a derivation which sets the environment variables and add
the resulting derivation to the "manifest".  However, I suspect I'm
misunderstanding the `#:env-vars` key to the `gexp->derivation`[5]
function.

Along this idea though, how difficult would it be to add an optional
parameter to `*->manifest` functions such that it constructs the profile
with additional environment variables?  Is that desirable?

>
> Since you use Direnv [3], maybe you can set the environment variables
> there instead of in the manifest file.

While this would work in general, I'm trying to add things that directly
reference computed store paths.  I'm not sure how I can easily achieve
this with `direnv`.

For example, I'm trying to set `LD_LIBRARY_PATH` to point to the `lib`
directory of the `z3` package.  Furthermore, I need to set `JAVA_HOME`
to the store path of `openjdk11-jdk`.


> 1: 
> 2: 
> 
> 3: 


I've had some success setting search paths[4], as here:

```
(define z3-with-java
  (package
   (inherit z3-4.8.10)
   (native-inputs
`(("which" ,which)
  ("python" ,python-wrapper)
  ("jdk" ,java:openjdk11 "jdk")))
   (arguments
`(#:tests? #f
  #:validate-runpath? #f
  #:phases
  (modify-phases %standard-phases
 (add-after 'unpack 'set-JDK_HOME
(lambda* (#:key inputs #:allow-other-keys)
  (setenv "JDK_HOME" (assoc-ref inputs "jdk"))
  #t))
 (replace 'configure
  (lambda* (#:key inputs outputs #:allow-other-keys)
(invoke "python" "scripts/mk_make.py"
"--java"
(string-append "--prefix=" (assoc-ref 
outputs "out")
 (add-after 'configure 'change-directory
(lambda _
  (chdir "build")
  #t)
   (native-search-paths
(list (search-path-specification
   (variable "LD_LIBRARY_PATH")
   (separator #f)
   (files (list "lib/")))
  (search-path-specification
   (variable "Z3_DIR")
   (separator #f)
   (files (list "")))
```

Unrelated to this whole thing, and likely in need of a new thread, how
do I translate the above package definition which overrides the inputs
to use the new gexp style[6]?

-Kenny

[4]: https://guix.gnu.org/en/manual/devel/en/guix.html#Search-Paths
[5]: 
https://guix.gnu.org/en/manual/devel/en/guix.html#index-gexp_002d_003ederivation
[6]: https://guix.gnu.org/en/blog/2021/the-big-change/


Re: how can I find the terminal output

2022-05-06 Thread Gottfried

Hello,
Don't mind if I am asking simple questions because I have to learn the 
basics.


How do I have to use "script"?
Do I have to enter "script" in the terminal before I start other 
commands, so that it will start to log my shell?
or can I, after a command with output, enter "script" and it will log my 
output in a file typescript?


I tried several times, but it didn't work. It didn't record anything, 
when I opened the file typescript.


So can you show me an example how to use it?
What Options are useful?

Gottfried



Am 02.05.22 um 14:53 schrieb Tobias Geerinckx-Rice:

Gottfried,

script(1) is the classic way to log your shell (or any) session to a text file.

See .

There's more fancy stuff like asciinema but that seems like overkill here.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.




OpenPGP_0x61FAF349C9FB7F94.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


guix-daemon error loading shared libraries

2022-05-06 Thread Greg Hogan
I am seeing the same symptoms as reported in #49102.
  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49102

$ guix describe
Generation 17 May 06 2022 18:17:56 (current)
  guix 0e94295
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 0e9429544fd737079b9c1562de3beb48329350a9

I have built guix from the same version (current master).

$ ./guix-daemon
./guix-daemon: error while loading shared libraries: libz.so.1: cannot open
shared object file: No such file or directory

$ ldd ./guix-daemon
linux-vdso.so.1 (0x7ffde5398000)
libz.so.1 => not found
libsqlite3.so.0 => not found
libgcrypt.so.20 => not found
libbz2.so.1.0 => not found
libstdc++.so.6 =>
/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libstdc++.so.6
(0x7f86ad507000)
libm.so.6 =>
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm.so.6
(0x7f86ad3c4000)
libgcc_s.so.1 =>
/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1
(0x7f86ad3aa000)
libc.so.6 =>
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6
(0x7f86ad1e8000)

/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2
(0x7f86ad6de000)

Is anyone else seeing this error?

Greg


How do you debug a channel?

2022-05-06 Thread Wil deBeest
Hi!
Something in my `local' channel causes an error when I execute `guix pull':

building /gnu/store/blb4jxbhdckbpcqf46yk74jrml1ds7wy-local.drv...
-builder for `/gnu/store/blb4jxbhdckbpcqf46yk74jrml1ds7wy-local.drv' failed to 
produce output path `/gnu/store/2klsbdwip925viqv5q8qla4zvnjqqr1i-local'
build of /gnu/store/blb4jxbhdckbpcqf46yk74jrml1ds7wy-local.drv failed
Could not find build log for 
'/gnu/store/blb4jxbhdckbpcqf46yk74jrml1ds7wy-local.drv'.
cannot build derivation 
`/gnu/store/7q1pb80q9jf2rpx40zpz2lklk6v5yvy7-profile.drv': 1 dependencies 
couldn't be built
guix pull: error: build of 
`/gnu/store/7q1pb80q9jf2rpx40zpz2lklk6v5yvy7-profile.drv' failed


I tried another pull with the `keep-failed' and `keep-going' flags added & 
`verbosity' and `debug' set to 7*, piping the output through `tee' in the hope 
of getting a complete log, but the file ended up empty.  The part I could copy 
from the terminal was rejected as spam by paste.debian.net, so I appended it to 
this mail.

Removing more and more packages from the channel until there wasn't any file 
left didn't help.  `guix pull' worked again only after removing the channel 
itself.

Any ideas what might be wrong or how to find out more?


Cheers!
Bo

* What levels are there?  I couldn't find the answer in 
`guix.git/guix/scripts/pull.scm'


|   |   building of 
`/gnu/store/yfig30krw0mnh6kwn1z7z6jkjnph3yr4-module-import-compiled.drv': init
|   |   building of 
`/gnu/store/yfig30krw0mnh6kwn1z7z6jkjnph3yr4-module-import-compiled.drv': 
loading derivation
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   substitution of 
`/gnu/store/ckf3mxanybfv6rbqysahpsa3p46f6g1m-module-import-compiled': created
|   |   substitution of 
`/gnu/store/ckf3mxanybfv6rbqysahpsa3p46f6g1m-module-import-compiled': woken up
|   |   building of 
`/gnu/store/5sjh4grn2g5sypzllcyxcp3qwv8awg0h-module-import.drv': init
|   |   building of 
`/gnu/store/5sjh4grn2g5sypzllcyxcp3qwv8awg0h-module-import.drv': loading 
derivation
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of 
`/gnu/store/5sjh4grn2g5sypzllcyxcp3qwv8awg0h-module-import.drv': all outputs 
substituted (maybe)
|   |   building of `/gnu/store/35np5f5gdsl6qayp45d7368bac08hyq3-git.scm.drv': 
created
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of `/gnu/store/35np5f5gdsl6qayp45d7368bac08hyq3-git.scm.drv': 
woken up
|   |   building of 
`/gnu/store/7vnql8i8z3b7q9xkp28wdxd632sxjbbb-guile-3.0.7.drv': created
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of 
`/gnu/store/7vnql8i8z3b7q9xkp28wdxd632sxjbbb-guile-3.0.7.drv': woken up
|   |   building of 
`/gnu/store/j9jhim8y26kvzhll5dnpxdd0fjspls2a-config.scm.drv': created
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of 
`/gnu/store/j9jhim8y26kvzhll5dnpxdd0fjspls2a-config.scm.drv': woken up
|   |   building of `/gnu/store/sywnigcng0jqc1lwcvy7g9aakcdxawy1-hash.scm.drv': 
created
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of `/gnu/store/sywnigcng0jqc1lwcvy7g9aakcdxawy1-hash.scm.drv': 
woken up
|   |   substitution of 
`/gnu/store/17fi3vg87j1lw9ygy3pcjf3pmpi79vkg-records.scm': created
|   |   substitution of 
`/gnu/store/17fi3vg87j1lw9ygy3pcjf3pmpi79vkg-records.scm': woken up
|   |   substitution of `/gnu/store/1f2frr4fcdb8gib7x3akr6vz3562g73v-i18n.scm': 
created
|   |   substitution of `/gnu/store/1f2frr4fcdb8gib7x3akr6vz3562g73v-i18n.scm': 
woken up
|   |   substitution of 
`/gnu/store/1n4yp3f1gfzixq6rzhn07glr5kxcfrpk-diagnostics.scm': created
|   |   substitution of 
`/gnu/store/1n4yp3f1gfzixq6rzhn07glr5kxcfrpk-diagnostics.scm': woken up
|   |   substitution of 
`/gnu/store/1qgssicbsibn03a5bhdx591jmpraxhnw-grafts.scm': created
|   |   substitution of 
`/gnu/store/1qgssicbsibn03a5bhdx591jmpraxhnw-grafts.scm': woken up
|   |   substitution of 
`/gnu/store/2kw5wrnpisgwf30cxgav3xdjcwgd81nk-trivial.scm': created
|   |   substitution of 
`/gnu/store/2kw5wrnpisgwf30cxgav3xdjcwgd81nk-trivial.scm': woken up
|   |   substitution of 
`/gnu/store/315axnaqf07pzkd1iqvmhc64xi2wjy1a-utils.scm': created
|   |   substitution of 
`/gnu/store/315axnaqf07pzkd1iqvmhc64xi2wjy1a-utils.scm': woken up
|   |   substitution of 
`/gnu/store/35h3vchibsm1gh1rmq8q24c6akm2sw4x-module-import-builder': created
|   |   substitution of 

Re: Cups Web Interface is Disabled

2022-05-06 Thread Les Campbell
Thanks for replying Gary.

I tried Nixos and Guix and recently decided on Nixos which I am using on a 
desktop computer. My laptop I will continue to use Arch which I am familiar 
with as a user since the late 1990's. One day I will make another change on my 
laptop.
-Les-
Sent from Mailspring 
(https://link.getmailspring.com/link/3c5e8431-cc90-4361-93c1-940b856d1...@getmailspring.com/0?redirect=https%3A%2F%2Fgetmailspring.com%2F=aGVscC1ndWl4QGdudS5vcmc%3D),
 the best free email app for work
On May 4 2022, at 7:28 am, Gary Johnson  wrote:
> Les  writes:
>
> > Gary, added the following:
> >
> > ```
> > (service cups-service-type
> > (cups-configuration
> > (web-interface? #t)))
> > ```
> >
> > This did not change the access to cups. The Web Interface still
> > remains Disabled.
> >
>
> 1. Make sure to import `cups-service-type` and `cups-configuration` in your 
> `use-modules` declaration at the top of the file.
> 2. Make sure that your `operating-system` declaration compiles without errors.
> 3. Remember to run `sudo guix system reconfigure /path/to/your/config.scm` to 
> add this service.
> 4. Make sure the CUPS service is running with `sudo herd status cups`.
> If not, you may need to start it manually or simply reboot your
> computer to bring it up automatically at init time.
>
> Good luck!
> --
> GPG Key ID: 7BC158ED
> Use `gpg --search-keys lambdatronic' to find me
> Protect yourself from surveillance: https://emailselfdefense.fsf.org
> ===
> () ascii ribbon campaign - against html e-mail
> /\ www.asciiribbon.org - against proprietary attachments
>
> Why is HTML email a security nightmare? See https://useplaintext.email/
> Please avoid sending me MS-Office attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html
>



Re: stumpwm on guix - "sb-cltl2" issues

2022-05-06 Thread Katherine Cox-Buday
Wil deBeest  writes:

> 
> Wil deBeest  writes:
>
>> 
>> Benjamin Slade  writes:
>> 
>>> I'm trying to run my long-standing stumpwm init.lisp on a recent Guix
>>> install, using the packaged stumpwm, however when it launches, it
>>> fails to process the init.lisp and gives me an "Don't know how to
>>> REQUIRE sb-cltl2." error.
>>> I've set the SBCL_HOME variable both in .xprofile and in the init.lisp
>>> itself [via `(sb-posix:putenv
>>> "SBCL_HOME=/run/current-system/profile/lib/sbcl/")' ], but this
>>> doesn't seem to help.
>>> Is there a good way around this? (On my other system I just compile
>>> stumpwm from source and install; I don't know if that makes a
>>> difference here.)
>>> —Ben
>> 
>> I used to have the same problem, but I don't remember what fixed it.
>> 
>> SBCL_HOME isn't set at all, I only have `exec 
>> /home/bovid-19/.guix-profile/bin/stumpwm' in my
>> `~/.xinitrc', and my stumpwm init file starts like this:
>> 
>> (in-package :stumpwm)
>> (require 'sb-cltl2)
>> 
>> 
>> I'm not sure what else I can look for.
>
> I have probably found the solution: in addition to stumpwm, I also have
> `cl-trivial-cltl2' and `cl-asdf' (and sbcl) in my system configuration.
> If you can confirm that those two packages are what was missing, we
> should add them to the stumpwm package as inputs.

I think I have this problem? But like Benjamin, it has also been a very long 
time since I addressed it. In my profiles, I include:

 "stumpwm"
 "sbcl-stumpwm-kbd-layouts"
 ;; net module has this unacknowledged dependency
 "sbcl-cl-ppcre"
 "sbcl-stumpwm-net"
 "sbcl-stumpwm-pass"
 "sbcl-stumpwm-stumptray"
 "sbcl-stumpwm-swm-gaps"
 "sbcl-stumpwm-ttf-fonts"

and I don't seem to have any problem. I start it from lightdm, and I don't 
think that's doing anything special.

Probably in my case some of the modules are including the missing dependencies.

I hope that helps somehow.

-- 
Katherine



Re: using dpkg-deb in a Guix package definition

2022-05-06 Thread Katherine Cox-Buday
Benjamin Slade  writes:

> Are there any good examples of writing a Guix package definition using dpkg?

I'm not sure if this helps, but I had to consume a deb and wrote a package that
unpacks it to get the binary:

https://github.com/kat-co/guix-channels/blob/non-free/non-free/packages/security.scm#L122-L127=

-- 
Katherine



Re: Seeking suggestions for fixing the R gpg package

2022-05-06 Thread zimoun
Hi,

On Thu, 05 May 2022 at 13:37, Kyle Andrews  wrote:

> (propagated-inputs (list r-askpass r-curl))
> (native-inputs (list pkg-config r-knitr gpgme))

[...]

> 8<-
> Error: package or namespace load failed for ‘gpg’:

I have looked at all the details, but ’gpg’ seems required, no?

Maybe try to add it as native-inputs.


Cheers,
simon