Re: Anyone got a steam controller and want to test a Guix driver?

2024-04-01 Thread Fredrik Salomonsson
Hi,

Steve George  writes:

> Hi,
>
> About a year ago Morgan Smith put in a Steam controlelr and steam deck 
> driver. I wondered if anyone on the list had one of these and wanted to try 
> out this using this patch: 
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58403
>
> Be great to get some testing and confirmation that this works.

Thanks for highlighting this.  I've recently switched to using guix on
my htpc and using a Steam controller for navigation.  While the default
settings works ok it would be great to be able configure them.  And I
got a steam deck with guix installed on it.  So I'll see if I can try
out the patch this week and report back.

I'll send my findings to the issue.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Best practice when dealing with a broken package for guix home?

2024-01-18 Thread Fredrik Salomonsson
Hi,

Simon Tournier  writes:

> Hi,
>
> On mar., 16 janv. 2024 at 18:41, Felix Lechner via  wrote:
>> On Tue, Jan 16 2024, Fredrik Salomonsson wrote:
>>
>>>  Or how do you deal with cases when they happen?
>>
>> I maintain a custom Guix with patches on top, plus my own channel.
>
> Well, for what it is worth, I think the good practise is to send
> contributions when something broken on master is fixed and not keep the
> fix in your own patched Guix version.

Agreed.  I should have probably worded my initial question a bit better.
I assumed that the package has already been reported by either myself or
someone else and that patches for it to be fixed was already submitted.
What prompted me to ask this question was [mpv-mpris][0].  Since it's
been broken since at least Dec 26 2023 and is the one that is holding up
my upgrade.  And I'm not trying to single anyone out, I totally
understand things take time especially during holidays.  I just got
thinking if there is a good practice to workaround it while I wait for
it to be fixed.  As doing any of my usual workarounds would require a
bit of work as it was mpv that changed and broke mpv-mpris.

[0] https://issues.guix.gnu.org/68044

> That said, I do not use “guix home” so my way probably does not make
> sense.  What I do is that I have separated manifest files.  For
> instance, I have emacs.scm for my Emacs stuff, ocaml.scm for my OCaml
> stuff, compiler.scm for some compilers that I use, base.scm for all the
> basic stuff as coreutils etc.
>
> When one package is broken, it impacts only one manifest.  So it
> mitigates the issue for upgrading.

I did this before, and while it did helped reduce the impact of a broken
package.  It did complicate my upgrade as I needed to have my own update
script etc.  What I like with guix home is that it can essentially
reproduce my home environment on any of my machines by both installing
the packages needed and configuration.  Which is a huge time saver as I
had the issue when I used Arch that I never really got my home
environment to work the same on my desktop and laptop.

>
> What I am not fully happy is that “guix weather” does not have a
> codified exit status.  It had been discussed [1] but no consensus.  It
> would ease:
>
>   guix weather -m path/to/manifests/foo.scm \
> && guix upgrade -p path/to/profiles/foo
>
> Cheers,
> simon
>
>
> 1: guix weather exit status?
> Leo Famulari 
> Thu, 08 Jul 2021 16:35:03 -0400
> id:yodhd7ffmovkj...@jasmine.lan
> https://lists.gnu.org/archive/html/guix-devel/2021-07
> https://yhetil.org/guix/yodhd7ffmovkj...@jasmine.lan

Didn't know that about guix weather.  I don't really use it that much as
my desktop is generally powerful enough to just chew threw packages that
lacks substitutes.  And I usually starts by upgrading that before moving
on to my laptop and other machines running guix.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Show notifications using Emacs' notifications-notify under Sway

2024-01-17 Thread Fredrik Salomonsson
Hi,

Rodrigo Morales  writes:

> I'm using Sway as my windows manager under Guix SD
>
> I can show notifications using =dunstify=
>
> #+BEGIN_SRC sh
> dunstify 'Title of the notification' 'Body of the notification'
> #+END_SRC
>
> When I try to show notifications using Emacs through the
> =notifications-notify= function (see first code block below), I get the
> following error (see second code block below)
>
> #+BEGIN_SRC elisp
> (notifications-notify
>  :timeout 3000
>  :title "title"
>  :body "body")
> #+END_SRC
>
> #+CAPTION: Buffer *Backtrace*
> #+BEGIN_SRC text
> Debugger entered--Lisp error: (dbus-error "No connection to bus" :session)
>   dbus-message-internal(1 :session "org.freedesktop.Notifications" 
> "/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" 
> dbus-call-method-handler :string "Emacs" :uint32 0 :string 
> "/gnu/store/9k0c9iija60rax5fwcss6v7ywzzzg438-emacs-..." :string "title" 
> :string "body" (:array) (:array :signature "{sv}") :int32 3000)
>   apply(dbus-message-internal 1 :session "org.freedesktop.Notifications" 
> "/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" 
> dbus-call-method-handler (:string "Emacs" :uint32 0 :string 
> "/gnu/store/9k0c9iija60rax5fwcss6v7ywzzzg438-emacs-..." :string "title" 
> :string "body" (:array) (:array :signature "{sv}") :int32 3000))
>   dbus-call-method(:session "org.freedesktop.Notifications" 
> "/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" 
> :string "Emacs" :uint32 0 :string 
> "/gnu/store/9k0c9iija60rax5fwcss6v7ywzzzg438-emacs-..." :string "title" 
> :string "body" (:array) (:array :signature "{sv}") :int32 3000)
>   notifications-notify(:timeout 3000 :title "title" :body "body")
>   (let ((print-level nil) (print-length nil)) (notifications-notify :timeout 
> 3000 :title "title" :body "body"))
>   (setq elisp--eval-defun-result (let ((print-level nil) (print-length nil)) 
> (notifications-notify :timeout 3000 :title "title" :body "body")))
>   elisp--eval-defun()
>   #(nil)
>   edebug--eval-defun(# nil)
>   apply(edebug--eval-defun # nil)
>   eval-defun(nil)
>   funcall-interactively(eval-defun nil)
>   command-execute(eval-defun)
> #+END_SRC
>
> I have 2 questions:
>
> 1. Does anyone know how to troubleshoot this error?

I'm not sure how to troubleshoot this.  But it looks like it cannot
connect to dbus.  Do you have one running for your user?  Not sure if
`dunstify` uses dbus or not.  

> 2. Are you able to notifications through Emacs using notifications-notify
>under Sway?

Yes, running your elisp snippet on my machine works as expected.  I'm
running `mako` via [guix home][0] instead of `dunst`.  I have a dbus
instance running as [my user][1].  And I'm running a [dbus command][2]
when launching sway to setup the some envirionment variables for dbus to
work with sway.  Maybe these can help?

[0] https://git.sr.ht/~plattfot/plt/tree/master/item/plt/home/mako.scm
[1] https://git.sr.ht/~plattfot/plt/tree/master/item/plt/home/sway.scm#L144
[2] https://git.sr.ht/~plattfot/plt/tree/master/item/plt/home/services.scm#L55

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Best practice when dealing with a broken package for guix home?

2024-01-16 Thread Fredrik Salomonsson
Hi,

Carlo Zancanaro  writes:

> On Sun, Jan 14 2024, Fredrik Salomonsson wrote:
>> 3) Copy an older definition that works to my custom channel, add a
>> prefix and use that until it is fixed.
>
> This is what I do. Or, more accurately, I copy it into my home.scm file
> and use the package object directly. That way it's clear why it exists,
> and it's easier to remove when I no longer need it.
>
>> My question what is the best practice for this? ... Maybe something
>> with the time-machine?
>
> I don't know about best practice, but I think at one point I did use
> inferiors for this (which is what time machine users under the hood).
> Unfortunately I can't remember why I stopped.
>
> If you'd like to go this way, the documentation in "(guix) Inferiors"
> has a short example of getting a package out of a different Guix
> version. It's pretty straightforward.

I'll check out Inferiors, thanks for the link.  It sounds like there are
some dragons going that route though.  So step 3 might be the happy
medium.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Best practice when dealing with a broken package for guix home?

2024-01-16 Thread Fredrik Salomonsson
Hi,

Felix Lechner  writes:

> Hi,
>
> On Sun, Jan 14 2024, Fredrik Salomonsson wrote:
>
>> My question what is the best practice for this?
>
> Guix Home is somewhat new. Not everyone uses it. There is some work to
> be done somewhere, as you already know.
>
> Any functional package manager will require you to specify a prior
> derivation in some form, with a closure over the prerequisites. I don't
> think Guix has such functionality, but folks with more experience should
> please speak up.
>
> A more practical way to mitigate your issuesn would be to improve the
> code quality in the development HEAD. For example, we could accept
> commits only when they do not break anything. Technically, a solution
> might be around the corner, but there is considerable disagreement in
> the project whether such a strict standard should be applied. It would
> most likely lead to countless rebuilds and unacceptable delays.

Yeah, I can see benefits going stricter but also keep it as is.
>
> Personally, I went for a simple solution with immediate benefits: I keep
> a branch that builds everything I need and advance it only every two
> months or so. I called it 'prebuilt.' You can find it as here:
>
> https://codeberg.org/lechner/guix/src/branch/prebuilt
>
> I know that's not what you wanted to hear, but it's all I can offer at
> this time.

That is fine, thank you for your input.  Interesting idea to keep a
branch of what you need.  Do you apply patches etc if you encounter a
broken package when you advance your branch?  Or how do you deal with
cases when they happen?

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Best practice when dealing with a broken package for guix home?

2024-01-14 Thread Fredrik Salomonsson


Hi,

Using guix home to manage my home environment is awesome.  But one thing
I haven't figured out is a good way of handling when one package is
broken.  As that effectively blocks any upgrade until that it is fixed.

There are generally three things I do in that case:

1) Temporarily remove it from my configuration if I don't use that
program that often.

2) Use `options->transformation` to pick a commit/branch etc that
compiles.

3) Copy an older definition that works to my custom channel, add a
prefix and use that until it is fixed.

If an issue isn't reported I usually send in a bug report with a patch
based on 2 or 3.  But most often someone else have reported it and I'm
just waiting on the patches to land upstream.

My question what is the best practice for this?  It feels that there
should be an easier/quicker way of handling this.  E.g. just tell guix
to use the definition of the current generation for that broken package
and continue with the rest.  Maybe something with the time-machine?

Thanks
-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Anyone got distrobox working?

2023-10-25 Thread Fredrik Salomonsson
Hi,

wolf  writes:

> Podman does work, but there is no built in service to configure it correctly.
> Snippet from my system configuration:
>
> (simple-service 'subugid-config etc-service-type
> `(("subuid" ,(plain-file "subuid" "wolf:10:65536\n"))
>   ("subgid" ,(plain-file "subgid" 
> "wolf:10:65536\n"
> (simple-service 'containers etc-service-type
> `(("containers/storage.conf" ,(plain-file 
> "containers-storage.conf" "[storage]\ndriver = \"btrfs\"\n"))
>   ("containers/policy.json" ,(local-file 
> "files/policy.json"
>
> And files/policy.json:
>
> {
> "default": [
> {
> "type": "insecureAcceptAnything"
> }
> ],
> "transports":
> {
> "docker-daemon":
> {
> "": [{"type":"insecureAcceptAnything"}]
> }
> }
> }
>
> After that, guix shell podman -- podman run --rm hello-world .
>

Thanks for sharing you configuration.  I think I got podman working with
the following system services:

```scheme
  (simple-service 'subugid-config etc-service-type
  `(("subuid" ,(plain-file "subuid" 
"plattfot:10:65536\n"))
("subgid" ,(plain-file "subgid" 
"plattfot:10:65536\n"
  (simple-service 'containers etc-service-type
  `(("containers/storage.conf" ,(plain-file 
"containers-storage.conf"
"\
[storage]
driver = \"btrfs\"
"))
("containers/policy.json" ,(plain-file "policy.json"
   "\
{
\"default\": [
{
\"type\": \"insecureAcceptAnything\"
}
],
\"transports\":
{
\"docker-daemon\":
{
\"\": [{\"type\":\"insecureAcceptAnything\"}]
}
}
}
"))
("containers/registries.conf" ,(plain-file 
"registries.conf"
"\
unqualified-search-registries = ['quay.io', 'docker.io']
[[registry]]
location='localhost:5000'
insecure=true
"
```

The hello-world from docker.io works, the one from quay.io does not.
But might be an issue on their side.

>> Has anyone got distrobox working and if so how?
>
> No idea about distrobox, but the above should get the podman working.

I got further with distrobox now when podman seems to be correctly
setup.

```
guix shell distrobox -- distrobox create -i docker.io/library/ubuntu:22.04
```

Works, but I cannot enter the container:

```
$ guix shell distrobox conmon runc -- distrobox enter ubuntu-22-04
Container ubuntu-22-04 is not running.
Starting container ubuntu-22-04
run this command to follow along:

 /gnu/store/yph7wgfp922w7ck6pclgq10mcg7j5gxi-podman-4.4.1/bin/podman logs -f 
ubuntu-22-04

 Error: could not start entrypoint.
+ '[' -n '' ']'
+ printf 'distrobox: Installing basic packages...\n'
++ basename /gnu/store/3g4msmrx9sswxzccv578h5cyk4a80zpg-bash-5.1.16/bin/bash
+ shell_pkg=bash
+ '[' bash = ash ']'
+ '[' 0 -ne 0 ']'
+ test -x find
+ test -x apk
+ test -x apt-get
+ test -x dnf
+ test -x emerge
+ test -x microdnf
+ test -x pacman
+ test -x slackpkg
+ test -x swupd
+ test -x xbps-install
+ test -x yum
+ test -x zypper
+ printf 'Error: could not find a supported package manager.\n'
+ printf 'Error: could not set up base dependencies.\n'
+ exit 127
+ '[' 127 -ne 0 ']'
+ printf 'Error: An error occurred\n'
distrobox: Installing basic packages...
Error: could not find a supported package manager.
Error: could not set up base dependencies.
Error: An error occurred
```

Looks like there are some missing OCI binaries, I used `--verbose` and
rerun it and saw this in the output:

```
$ guix shell distrobox conmon runc -- distrobox enter ubuntu-22-04 --verbose
…
DEBU[] [graphdriver] trying provided driver "btrfs" 
DEBU[] Initializing event backend file  
DEBU[] Configured OCI runtime crun-wasm initialization failed: no valid 
executable found for OCI runtime crun-wasm: invalid argument 
DEBU[] using runtime "runc" from $PATH: 
"/gnu/store/vfgxc5n2ygac691iivfjmd3nn9ywk9wx-profile/sbin/runc" 
DEBU[] Configured OCI runtime kata initialization failed: no valid 
executable found for OCI runtime kata: invalid argument 
DEBU[] Configured OCI runtime youki initialization failed: no valid 
executable found for OCI runtime youki: invalid argument 
DEBU[] Configured OCI runtime ocijail initialization failed: no valid 
executable found for OCI runtime ocijail: invalid argument 
DEBU[] Configured OCI runtime runj initialization failed: no valid 
executable found for OCI runtime runj: invalid argument 
DEBU[] Configured OCI runtime runsc initialization failed: no valid 
executable found for OCI runtime runsc: invalid argument 
DEBU[] 

Anyone got distrobox working?

2023-10-24 Thread Fredrik Salomonsson
Hi,

I noticed that guix has [distrobox][0] packaged but it does not seem to
work.

```sh
$ guix shell distrobox -- distrobox create -i ubuntu:22.04
Image ubuntu:22.04 not found.
Do you want to pull the image now? [Y/n]: 
Error: short-name "ubuntu:22.04" did not resolve to an alias and no 
containers-registries.conf(5) was found
```

```sh
guix shell distrobox -- distrobox create -i docker.io/library/ubuntu:22.04
Image docker.io/library/ubuntu:22.04 not found.
Do you want to pull the image now? [Y/n]: 
Error: open /etc/containers/policy.json: no such file or directory
```

>From what I understand I need to properly setup podman with
/etc/containers populated with the right configs.  I've looked around
but I cannot find any docs or services that allows me to do that.
Checked the mailing and IRC archives but could not find any useful
information.  Apart from maybe podman does not work on guix.

Has anyone got distrobox working and if so how?

Thanks

[0] https://distrobox.it/
-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Question regarding qmk firmware

2023-10-10 Thread Fredrik Salomonsson


Hi Ekaitz,

Ekaitz Zarraga  writes:

> Hi Fredrik,
>
> Now what you need to do is call to the `make-avr-toolchain` function from 
> `(gnu packages avr)` to get that.
>
> Maybe the easiest way is to create a `manifest.scm` where you do something 
> like this (i'm doing it by memory):
>
> ``` scheme
> (use-modules (gnu packages avr)
>  (gnu packages flashing-tools)
>  (gnu packages firmware))
>
> (packages->manifest (list (make-avr-toolchain) dfu-programmer qmk))
> ```
>
> Then use `guix shell -m manifest.scm`.
>
> There are other ways to do it, but I find this the easiest.

Thank you for pointing me in the right direction!  This is what I ended
up with:

```scheme
(use-modules
 (gnu packages embedded)
 (gnu packages flashing-tools)
 (gnu packages firmware))

(packages->manifest
 (list (make-arm-none-eabi-nano-toolchain-6)
   dfu-util
   qmk))
```
Then just simply run

```sh
guix shell -m manifest.scm -- qmk flash -kb ergodox_infinity -km plattfot -bl 
dfu-util-split-left
```
And that worked like a charm.

I had forgotten that my ergodox is using different tools than my kyria.
Also the nano lib threw me for a loop.  I was using the
`make-arm-none-eabi-toolchain-6` at first.

> You can even make a package for your firmware and let guix compile it
> for you (and maybe flash it too?).

Oh, that sounds that it might be useful.  Especially if it can flash it
too.  As I have a few keyboards and not all keymaps are pushed upstream
(yet).

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Question regarding qmk firmware

2023-10-07 Thread Fredrik Salomonsson
Hi,

Today I was tweaking a keymap for one of my qmk based keyboards but some
of the packages I used when building the firmware has been removed.  My
commad was as follows:

```sh
guix shell avr-toolchain dfu-programmer qmk -- qmk flash -kb 
ergodox_infinity -km plattfot -bl dfu-split-left
```

But `avr-toolchain` is gone.  When I tried to just drop it and see if it
worked I get

```
Ψ Compiling keymap with make --jobs=1 ergodox_infinity:plattfot:dfu-split-left


QMK Firmware 0.14.19
Making ergodox_infinity with keymap plattfot and target dfu-split-left

/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/sh: line 1: 
arm-none-eabi-gcc: command not found
```

It seems `arm-none-eabi-toolchain` is also removed.  Looking at the
commit history for guix it looks like they got replaced by
[proceduers][0] instead.

[0] 
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=35c1df5bd6317b1cd038c1a4aca1c7e4a52d4d93

My question is how do I get access to the arm-none-eabi-toolchain from
the commandline with guix shell?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Nested modify-services

2023-06-04 Thread Fredrik Salomonsson
"("  writes:

> Fredrik Salomonsson  writes:
>> guix system: warning: exception caught while executing 'eval' on service 
>> 'root':
>> error: remove: unbound variable
>> guix system: warning: some services could not be upgraded
>> hint: To allow changes to all the system services to take effect, you will 
>> need to reboot.
>
> This appears to be unrelated to MODIFY-SERVICES. No idea what it
> actually means, though, other than the obvious 'remove' being unbound...

Yeah, it could be totally unrelated.  It is at least triggered when I
have nested modify-services.  But could just be a red herring.

>> Is nesting modify-services supported, I.e call modify-services on a list
>> that already been modified by modify-services?
>
> It has to be.  %BASE-SERVICES and %DESKTOP-SERVICES are themselves
> constructed with MODIFY-SERVICES ^_^

Ok, that's good :).  Then at least I'm not using an unsopported
workflow[0].

[0] https://xkcd.com/1172/

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Nested modify-services

2023-06-04 Thread Fredrik Salomonsson
Hi Guix,

Yesterday I encountered an issue when I updated my desktop machine:

  sudo -i guix pull && sudo -i guix system reconfigure 
~/projects/plt/plt/system/machines/surt.scm 
--8<
…
guix system: warning: exception caught while executing 'eval' on service 'root':
error: remove: unbound variable
guix system: warning: some services could not be upgraded
hint: To allow changes to all the system services to take effect, you will need 
to reboot.

>8--

But I didn't get that with my laptop.  Both share a lot of the same
system configuration as I've created my own channel[0], where I have both
configs inherting from a common config.  I traced the issue to how I was
setting up the extra services on my desktop machine[1]:

--8<
(define plt-surt-os
  (operating-system
(inherit %plt-base-operating-system)
(host-name "surt")
  ;; …
  (services
(cons*
  ;; …
  (service console-font-service-type
   (map (lambda (tty)
  (cons tty (file-append font-terminus 
"/share/consolefonts/ter-132n")))
'("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
   (modify-services
   %plt-base-services
 (delete console-font-service-type))

>8--

Where my %plt-base-services[2] is defined as:

--8<
(define %plt-base-services
  (cons*
   (service plt-home-rottlog-service-type)
   (service plt-automount-service-type)
   ;; …
   (modify-services
%desktop-services
(delete gdm-service-type)
(network-manager-service-type
 config => (network-manager-configuration
(inherit config)
(dns "dnsmasq")
(vpn-plugins (list network-manager-openconnect
   ;; …
)))

>8--

If I remove the modify-services call on my desktop machine, or move it
to %plt-base-services.  The error goes away.  I noticed that
there was a recent change in modify-services[3] that is most likely
behind my issue.

Is nesting modify-services supported, I.e call modify-services on a list
that already been modified by modify-services?  If not, what would be
the best way of sharing services between configurations and allow for
custom tweaks per machine.

Thanks!

[0] https://git.sr.ht/~plattfot/plt
[1] 
https://git.sr.ht/~plattfot/plt/tree/2abf21f5/item/plt/system/machines/surt.scm
[2] https://git.sr.ht/~plattfot/plt/tree/2abf21f5/item/plt/system/machines.scm
[3] 
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=dbbc7e946131ba257728f1d05b96c4339b7ee88b

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Trouble with nfs mount

2022-10-17 Thread Fredrik Salomonsson
Hi,

Maxim Cournoyer  writes:

> Hi,
>
> Fredrik Salomonsson  writes:
>
> [...]
>
>> ---✂
>> …
>> shepherd: Evaluating user expression (and (defined? (quote transient?)) (map 
>> (# ?) ?)).
>> guix system: warning: exception caught while executing 'start' on service 
>> 'file-system-/media/Valhalla':
>> In procedure mount: mount "fafner:/srv/nfs4/Valhalla" on 
>> "///media/Valhalla": Invalid argument
>> guix system: warning: some services could not be upgraded
>> …
>> 
>>
>> So that's probably what's happening during boot.
>>
>> I have no idea how it transforms the mount-point from "/media/Valhalla"
>> to "///media/Valhalla" and if that's a red herring.
>>
>> Any ideas what I'm doing wrong?
>
> Nothing; mounting an NFS file system at boot is not supported currently
> with Guix System; see the related issue #47706.

Ah, ok. Thanks for the info.

> My current ugly workaround is to define the mount points with "(mount?
> #f)" and mount them via a script post boot, e.g.:
>
> --8<---cut here---start->8---
> (file-system
>   (device "jami-buildmachine-04:/srv/nfs/jami")
>   (mount-point "/var/cache/jami")
>   (create-mount-point? #t)
>   (type "nfs")
>   (mount? #f)
>   (options "soft,user"))
> --8<---cut here---end--->8---

Yeah, I think I'll just add a shepherd service to my home configuration
that mounts and unmounts my NFS device until this is resolved.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Trouble with nfs mount

2022-10-17 Thread Fredrik Salomonsson
Hi,

Felix Lechner  writes:

> Hi Fredrik,
>
> On Sun, Oct 16, 2022 at 6:08 PM Fredrik Salomonsson  
> wrote:
>>
>> it was indeed using the entry in the /etc/fstab, i.e:
>
> That's good! My guess is that the Shepherd service is not working
> correctly, for example by not requiring networking. I might ask over
> there.
>
> Sorry I cannot be of more help. I currently also mount all my NFS
> volumes manually, and would like to do it automatically, too.

No worries, looks like it's not supported at the moment.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Trouble with nfs mount

2022-10-16 Thread Fredrik Salomonsson


Hi Felix,

Felix Lechner  writes:

> Hi Fredrik,
>
> On Sun, Oct 16, 2022 at 2:47 PM Fredrik Salomonsson  
> wrote:
>>
>> I can manually mount it.
>
> Can you mount it manually using your entry in /etc/fstab, i.e. with
> 'noauto' and then just
>
> mount /media/Valhalla  ?
>
> I am not sure whether (mount? #f) sets 'noauto'.
>
> That would confirm that your fstab entry is working.

Sorry I didn't express myself that clearly. What I meant with manually
mount it was indeed using the entry in the /etc/fstab, i.e:

  mount /media/Valhalla

So the fstab entry is working. I didn't set 'noauto' though, but it
doesn't auto mount. Which I guess means that noauto is implicitly set.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Trouble with nfs mount

2022-10-16 Thread Fredrik Salomonsson
Hi Guix,

I'm having some issues with my nfs storage on Guix System.

Here is the part of my configuration that deals with mounting the nfs
device.

  (define nfs-valhalla
(file-system
 (device "fafner:/srv/nfs4/Valhalla")
 (mount-point "/media/Valhalla")
 (options "auto,_netdev,timeo=10")
 (type "nfs4")
 (mount? #f)
 (check? #f)))

  (operating-system
   ;; …
   (file-systems
(cons*
 ;; …
 nfs-valhalla
 %base-file-systems)))

cat /etc/fstab:
---✂
  …
  fafner:/srv/nfs4/Valhalla /media/Valhalla nfs4auto,_netdev,timeo=10   


As you can see Guix creates it just fine in /etc/fstab. I can manually
mount it. But if it's mounted when I'm shutting down the system it will
block. Sheperd will wait for some process to finish (which I assume is
the nfs mount). It works fine if I manually unmount it before shutting
down.

If I set it to mount on boot, it wont reach the tty prompt. Instead it
will get stuck somewhere along the boot process (grub menu to the
rescue). I do see shepherd failing to mount it after I've run guix
system reconfigure.

---✂
…
shepherd: Evaluating user expression (and (defined? (quote transient?)) (map (# 
?) ?)).
guix system: warning: exception caught while executing 'start' on service 
'file-system-/media/Valhalla':
In procedure mount: mount "fafner:/srv/nfs4/Valhalla" on "///media/Valhalla": 
Invalid argument
guix system: warning: some services could not be upgraded
…


So that's probably what's happening during boot.

I have no idea how it transforms the mount-point from "/media/Valhalla"
to "///media/Valhalla" and if that's a red herring.

Any ideas what I'm doing wrong?

Thanks!

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Combine locales

2022-09-25 Thread Fredrik Salomonsson
Hi Sergiu,

Sergiu Ivanov  writes:

> Hi Fredrik,
>
> Fredrik Salomonsson  [2022-09-25T01:35:12+0200]:
>>
>> One thing I cannot figure out is how to setup the operating-system to
>> use English as the language but use Swedish for the date format. Similar
>> to what is described in Locale Names[0] in the libc manual.
>>
>> I.e. on my foreign distro I have /etc/locale.conf define:
>> ---✀
>> LANG=en_US.UTF-8
>> LC_TIME=sv_SE.UTF-8
>> 
>>
>> In my operating-system configuration system I have:
>> ---✀
>> (operating-system
>>  ;;…
>>  (locale "en_US.utf8")
>>  (locale-definitions
>>   (list
>>(locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8"))
>>(locale-definition (name "sv_SE.utf8") (source "sv_SE") (charset 
>> "UTF-8"
>>  ;;…
>> )
>> 
>
> I use a similar definition in operating-system, and I set up additional
> locale parameters in my Guix Home configuration, using the
> environment-variables field in home-bash-configuration [0].

It did not occur to me to put them in my bash configuration, that's
clever.

> I think it's fine if you launch everything from a shell, but it will
> probably not work if you extensively use a graphical
> desktop environment.
> [0] https://guix.gnu.org/manual/devel/en/html_node/Shells-Home-Services.html

Yeah, I'm launching sway from my bash profile so that worked out well.
However I couldn't use environment-variables, but instead I needed to
put them directly in bash-profile [0]. Otherwise they would be defined
below my snippet for launching sway and not be defined for the sway
session.

It seems to be working now though, e.g. the clock in waybar now shows
the date in Swedish.

Thank you for the help!

[0] 
https://git.sr.ht/~plattfot/plt/tree/d8ad5f4a41fb607bfd0d890fcaf89990ed1a95ef/item/plt/home/bash.scm

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Combine locales

2022-09-24 Thread Fredrik Salomonsson
Hi all,

I'm slowly transition my computers to running Guix System instead Guix
on a foreign distro. Starting with my laptop, as that is not that
critical right now.

One thing I cannot figure out is how to setup the operating-system to
use English as the language but use Swedish for the date format. Similar
to what is described in Locale Names[0] in the libc manual.

I.e. on my foreign distro I have /etc/locale.conf define:
---✀
LANG=en_US.UTF-8
LC_TIME=sv_SE.UTF-8


In my operating-system configuration system I have:
---✀
(operating-system
 ;;…
 (locale "en_US.utf8")
 (locale-definitions
  (list
   (locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8"))
   (locale-definition (name "sv_SE.utf8") (source "sv_SE") (charset "UTF-8"
 ;;…
)


I have checked the guix manual, but cannot find any information about
this. Is it not supported?

[0] https://www.gnu.org/software/libc/manual/html_node/Locale-Names.html

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: What Python IDE are you using?

2022-08-23 Thread Fredrik Salomonsson
Luis Felipe  writes:

> On Tuesday, August 23rd, 2022 at 23:39, Luis Felipe 
>  wrote:
>
>> On Tuesday, August 23rd, 2022 at 21:20, Fredrik Salomonsson 
>> platt...@posteo.net wrote:
>> 
>
>> > I generally use emacs + eglot [0]. It works great out of the box for me,
>> > zero configuration on my part. I can't speak much about speed as the
>> > python programming I do is over tramp, which tends to slow things down.
>> 
>
>> I tried both emacs-lsp-mode and eglot today, but autocompletion didn't work 
>> in any of them. They both seem to use company-mode by default, the same as 
>> emacs-elpy. Is autocompletion working for you? If yes, what version of Guix 
>> are you using? (I'm on Guix System 3f17158, emacs-company 0.9.13).
>
> Hmm, I just ran Emacs in three separate guix containers, one for an LSP 
> mode-based IDE, one for an Eglot-based IDE and one for an Elpy-based IDE. In 
> each of these containers, I ran "emacs -q -l CONFIG.el" to avoid loading any 
> "init.el" file, and instead load a specific, minimal configuration file for 
> each IDE. Autocompletion worked in all of them.
>
> So it seems something in my "~/.congig/emacs/init.el" is not right anymore 
> for my current generation of Emacs packages...

Yeah, sounds like something in your config is breaking the autocomplete.
I don't use company anymore but instead I use corfu. I am using guix
92b25a0 on a foreign distro, with emacs-eglot@1.8 and emacs-corfu@0.26.
And emacs-pgtk-native-comp@28.1.90-224.03fe258 from the flat channel
d95204c. And autocomplete works fine on my end.

> I think I found emacs-lsp-mode faster than eglot, and the 
> autodocumentation/help in the latter was kind of distracting because it 
> displays too much information for the symbol
> at point, which makes the minibuffer change hight frequently.

Right, I forgot a do actually have some configuration associated with eglot.

try 

  (setf eldoc-echo-area-use-multiline-p nil)

That should take care of the minibuffer issue. As I also was quite
annoyed with that.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: What Python IDE are you using?

2022-08-23 Thread Fredrik Salomonsson
Hi,

Luis Felipe  writes:

> Hi,
> What do you use to program in Python? Is the IDE you use dependable or does 
> it present these kinds of frequent problems too?

I generally use emacs + eglot [0]. It works great out of the box for me,
zero configuration on my part. I can't speak much about speed as the
python programming I do is over tramp, which tends to slow things down.

[0] https://github.com/joaotavora/eglot

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Guix home user-level shepherd services

2022-06-16 Thread Fredrik Salomonsson
Tangonov  writes:

> Thanks Fredrik!
>

No problem.

> I really struggle with subtle details that are a few paragraphs 
> deep, and so, I am embarassed.
>

Don't be, hard to know where everything is. It took me a while to find
the docs for it as I was first looking for it in the Guix manual.

> If anyone else is reading this for reference: I should not have 
> set =#:user #:t= for =make-forkexec-constructor=. The =#:user= 
> keyword expects a string. My user is implicitly when left with the 
> default value.
>

I'm glad you figured it out! I totally missed the #:user option.

> If I may say so, this has been easier to learn than systemd 
> services. After many years of mostly failing to use systemd 
> properly, I have not yet mastered it.
>
> My user-level services are running :)

Great!

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Guix home user-level shepherd services

2022-06-16 Thread Fredrik Salomonsson
Hi Tangonov,

Tangonov  writes:

> Ok, it seems as though I had some bash configuration issues. My 
> "$(inline commands)" made things unhappy for some reason.
>
> I resolved them, and shepherd started working...except that herd 
> was totally bound up and not responsive. I had to kill it to 
> reconfigure.
>
> I assumed this is because the services were holding stuff up...so 
> I tried a forked config:
>
> #+BEGIN_SRC scheme
> (service home-shepherd-service-type
>  (home-shepherd-configuration
>   (services (list
>  (shepherd-service
>   (provision '(syncthing))
>   (start #~(make-forkexec-constructor
> "syncthing" #:user #:t))
>   (stop #~(make-kill-destructor))
>   (documentation
>"Synchronize folders to other 
>device"))
>  (shepherd-service
>   (provision '(pantalaimon))
>   (start #~(make-forkexec-constructor
> "pantalaimon" #:user #:t))
>   (stop #~(make-kill-destructor))
>   (documentation
>"Crypto back-end server for 
>ement.el"))
> #+END_SRC
>
> The forked service does not seem to work :/
>
> #+BEGIN_QUOTE
> λ herd start pantalaimon
> herd: exception caught while executing 'start' on service 
> 'pantalaimon':
> Throw to key `match-error' with args `("match" "no matching 
> pattern" "pantalaimon")'.
> #+END_QUOTE
>

The issue is most likely that make-forkexec-constructor's COMMAND
argument expects a list of strings [0]. Try and see if this works:

#+BEGIN_SRC scheme
(service home-shepherd-service-type
 (home-shepherd-configuration
  (services (list
 (shepherd-service
  (provision '(syncthing))
  (start #~(make-forkexec-constructor
(list "syncthing") #:user #:t))
  (stop #~(make-kill-destructor))
  (documentation
   "Synchronize folders to other 
   device"))
 (shepherd-service
  (provision '(pantalaimon))
  (start #~(make-forkexec-constructor
(list "pantalaimon") #:user #:t))
  (stop #~(make-kill-destructor))
  (documentation
   "Crypto back-end server for 
   ement.el"))
#+END_SRC

[0] 
https://www.gnu.org/software/shepherd/manual/html_node/Service-De_002d-and-Constructors.html#Service-De_002d-and-Constructors

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Setting up a geiser development environment

2022-06-01 Thread Fredrik Salomonsson


Hej,

Einar Largenius  writes:

> Hi, thanks for the reply.
>
> I want to have geiser accessible. It would make trailing and error and
> finding symbols much easier.
>
>> (use-modules (gnu packages))
>
> I forgot to include this in my example. The Geiser repl tells me there are
> no code for the module. It works fine when using guix repl though.
>
> I checked the value of %load-path when I start geiser and compare it
> with the value I get with guix repl. They look very similar except the
> load path provided with guix repl is provides an additional path:
>
> 
> "/gnu/store/6qfk8gs9qyk5vx79bb62gf4gz9n7wp95-guix-module-union/share/guile/site/3.0"
>
> I don't find anything similar in my .guix-profile.

Yeah, it is the same on my machine. I'm using guix on a foreign distro.
I poked around with this a bit yesterday but couldn't find a satisfying
solution. But my solution for #2 came quite close.

>
> I see a few alternatives.
>
> 1. Identify which package includes this "guix-module-union" and add it
>to my profile.

The one that includes that is guix itself. And that is stamped into the
guix commandline tool.

See:

cat `which guix`

Or guix/self.scm:581 and guix/self.scm:515 in the source code.

Closest you get is adding guix to a temporary profile like

guix shell guix guile

I would not recommend adding guix to your .guix-profile, as that messes
up quite a few things. The guix you install is not neccessary the guix
you are running. It gets really meta when you install your package
manager with your package manager :). So I would recommend using
`guix shell` for that.

> 2. Dynamically add the path using wildcards to my .guile startup file.
>Adding a hardcoded path will break this during every update.

This will not break during every update, but highly likely to break when
you run `guix gc`. As it is then paths are deleted in the store.

Best I came up with is to first export the development environment of
guix using:

guix shell guile --development guix --export-manifest

This will give you something that looks like this:

---8<---
;; What follows is a "manifest" equivalent to the command line you gave.
;; You can store it in a file that you may then pass to any 'guix' command
;; that accepts a '--manifest' (or '-m') option.

(concatenate-manifests
  (list (specifications->manifest (list "guile"))
(package->development-manifest
  (specification->package "guix"
--->8---

Then add your current guix's guile paths to the guile environment
variables (assuming you have bash or something equivalent):

---8<---
export 
GUILE_LOAD_PATH=$HOME/.config/guix/current/share/guile/site/3.0:$GUILE_LOAD_PATH
export 
GUILE_LOAD_COMPILED_PATH=$HOME/.config/guix/current/lib/guile/3.0/site-ccache:$GUILE_LOAD_COMPILED_PATH
--->8---

Just adding the current guix's guile paths to guile will not include the
dependencies guix needs. E.g. you'll see error messages like these `no
code for module (gcrypt hash)` when trying to use (gnu packages).

This is what `--development guix` in guix shell or
`(package->development-manifest (specification->package "guix"))` in the
manifest do. I.e. it will specify the development environment for guix.

Then you can either use `guix shell -m ` to setup the package
environment or `guix package -m ` to install the packages to
your .guix-profile. Note that `guix package -m ` will remove
all packages installed to the profile that are not listed in the
manifest. So do a `guix package --export-manifest` first and combine
that with the manifest above.

An alternative to the autogenerated manifest from `guix shell`, is to
simply fetch the propagated-inputs from the guix package and add that to
the manifest:
---8<---
(use-modules
  (guix packages);; For package-propagated-inputs
  (gnu packages) ;; For specifications->manifest
  (gnu packages package-management)) ;; Access to the guix package

(specifications->manifest
 `(
   "guile"
   ,@(map car (package-propagated-inputs guix))
   ))
--->8---

The (map car …) is to just return the name of each propagated-input of
the guix package. As for the `(…) and ,@ see the quasiquote section in
the guile manual[0].

[0] https://www.gnu.org/software/guile/manual/html_node/Expression-Syntax.html

> 3. Change so that geiser uses "guix repl" instead of "guile" when
>starting a repl.
>

I quickly tested this by setting `geiser-guile-binary` to "guix repl".
But it expects a name to a binary and not a binary with arguments. It is
probably doable but would 

Re: Setting up a geiser development environment

2022-05-27 Thread Fredrik Salomonsson


Hi,

Einar Largenius  writes:

> Hello!
>
> I am trying to learn using guix and I think having access to a usable
> repl would be helpful.
>
> I have installed geiser to use with guix. I use the ELPA version of
> geiser. I installed guix on a foreign distro with the installation
> script found on the website.
>
> What do I need to do to make guix symbols available for use with a REPL?
>
> For example, I open a scheme file in Emacs and start geiser, but when I
> evaluate for example:
>
> (specifications->manifest
>  (list "guile"))
>
> It says specifications->manifest is unbound.
>

You need to have guix in the %load-path variable, then load the module
containing `specifications->manifest`. The easiest way is to just run 

guix repl

from a terminal (or shell in emacs) to get a repl.


Or if you want to use geiser you can use guix shell to setup the right
environment and launch emacs

guix shell guix guile --emacs

Once you got the correct load path setup you can just import the module
containing `specifications->manifest` in the repl.

(use-modules (gnu packages))

To find which module that contain that procedure, you can search for it
in the guix manual and it will say just above it what module it
contains.

Alternative you can clone the guix repo and call something like
consult-ripgrep in emacs on it with the search term
#specifications->manifest#define

The guix manual will also describe how to setup emacs for hacking on
guix [0] that might be useful.

[0] https://guix.gnu.org/manual/en/html_node/The-Perfect-Setup.html

I hope that helps.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: i18n guix module error when opening shell after guix home reconfigure

2022-01-16 Thread Fredrik Salomonsson
Hi,

Jelle Licht  writes:

> Hello Roland,
>
> Sad prefix: I don't have a solution for you, nor am I a guix home
> expert, but I can confirm that I also run into the issue. 
>
> On my VM, I actually used an almost-default bash configuration, but run
> into the very same issue.
>
> Roland Everaert via  writes:
>
>> Hello,
>>
>> First, happy new year and best wishes for this year.
>>
>> I have updated my guix home configuration to use my zsh config instead of a 
>> blank bash configuration.
>>
>> Unfortunatelly, when I logout and login again, I face the following errors:
>> -
>> Backtrace:
>> 9 (primitive-load "/home/roland/.guix-home/on-first-login")
>> In ice-9/eval.scm:
>> 721:20 8 (primitive-eval (begin (use-modules (guix i18n)) (# …) …))
>> In ice-9/psyntax.scm:
>> 1230:36 7 (expand-top-sequence ((begin (use-modules (guix …)) …)) …)
>> 1090:25 6 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
>> 1222:19 5 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
>> 259:10 4 (parse _ (("placeholder" placeholder)) (()) _ c (eval) …)
>> In ice-9/boot-9.scm:
>> 3927:20 3 (process-use-modules _)
>> 222:17 2 (map1 (((guix i18n
>> 3928:31 1 (_ ((guix i18n)))
>> 3329:6 0 (resolve-interface (guix i18n) #:select _ #:hide _ # _ # …)
>>
>> ice-9/boot-9.scm:3329:6: In procedure resolve-interface:
>> no code for module (guix i18n)
>
> It seems that my $HOME/.guix-home/on-first-login assumes that guix's
> guile modules are available to the guile interpreter that is listed in
> the shebang;
>
>> Any idea what might cause such trouble?
>
> If you are not worried about temporarily running some older software,
> could you try and see if running:
>
> --8<---cut here---start->8---
> guix time-machine --commit=2719dfa631 -- home reconfigure your-home-config.scm
> --8<---cut here---end--->8---
>
> works for you? This will get guix to use an older copy of itself to
> build and 'install' your home environment.

I'm also encountering this issue running guix on a foreign distro. Not
sure which commit it stopped working, but it's broken in:

172bd0b5cde2609389fd16d18862b5b612c4b000

works when I use the guix time-machine command above.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Foreign distro Unity desktop broken after guix update

2021-12-29 Thread Fredrik Salomonsson
Thorsten Wilms  writes:

> I since learned that setting the paths like that makes the Ubuntu-side
> work, but guix stuff will fail. Gnucash bails out, Inkscape segfaults
> and GIMP runs without toolbox icons. Also, with a bit of thought,
> GDK_PIXBUF_MODULE_FILE must point to one file; it can’t be a chain of
> paths.
>
> Thus at the very least GDK_PIXBUF_MODULE_FILE must be one thing for
> Ubuntu and another for guix. Short of running all guix-installed stuff
> from a terminal after setting the variable there, is there any
> solution?

Perhaps create a local copy of the .desktop file for each guix
controlled application and modify it to set the correct environment
variables?

I've done that for certain applications where I needed to add custom
arguments to the command for it to scale properly with my monitors. I
placed mine in $HOME/.local/share/applications aka
$XDG_DATA_HOME/applications

> I also found out that plain `gdk-pixbuf-query-loaders` resolves to the
> guix version. The Ubuntu version resides at
> /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders
>
> My current theory is that this pixbuf-mixup has been going on for
> longer, but only a recent guix update made stuff incompatible. In
> addition, some caching might complicate matters.

That sounds very likely. I had a similar issue with python, where my
foreign distro updated to python-3.10 but guix is still on 3.9. Things
started breaking as I had missed to move everything to guix.

> Thank you for your thoughts, Fredrik!

No problem, I hope you can sort it out.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Foreign distro Unity desktop broken after guix update

2021-12-28 Thread Fredrik Salomonsson


Thorsten Wilms  writes:

> On Mon, 27 Dec 2021 22:17:22 +0100
> Thorsten Wilms  wrote:
>
>> > env LD_DEBUG=libs LD_DEBUG_OUTPUT=/tmp/trace 
>> 
>> Interesting, but I’m puzzled about how to use that with compiz/unity.
>
> I noticed that some icons in GNOME-applications are missing, so any of
> those might do in place of compiz. They all belong to Ubuntu, not guix.
>
> The result of `env LD_DEBUG=libs LD_DEBUG_OUTPUT=/tmp/trace
> gnome-calculator` told me that /gnu/store paths are checked first and
> exclusively for several libraries.
>
> LD_LIBRARY_PATH is empty and `env | grep /gnu/store` prints nothing,
> but env does contain
> ```
> GDK_PIXBUF_MODULE_FILE=/home/thorwil/.guix-profile/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
> GIO_EXTRA_MODULES=/home/thorwil/.guix-profile/lib/gio/modules:/home/thorwil/.guix-profile/lib/gio/modules
> LIBRARY_PATH=/home/thorwil/.guix-profile/lib:/home/thorwil/.guix-profile/lib
> ```

Ok, GNOME probably have some other methods of dynamically load
libraries. The GDK_PIXBUF_MODULE_FILE looks suspicious. I'm
not familiar with GNOME and its tool kits. 

> I don’t recall ever doing anything about those; they are not defined
> in .profile or .bashrc.

They're defined in your guix profile. E.g I got GDK_PIXBUF_MODULE_FILE
defined in both

~/.guix-profile/etc/profile

and

~/.guix-home/profile/etc/profile

And as far as I can tell those gets added to the profile when another
package needs them.

> I added
> ```
> export 
> GDK_PIXBUF_MODULE_FILE=/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache:/home/thorwil/.guix-profile/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
> export LIBRARY_PATH=/usr/lib:/home/thorwil/.guix-profile/lib
> ```
> to .profile. Now I have all icons back! Guess there’s a better way?

Nice! I'm not sure there's a better way, other than having guix control
the full GNOME stack (which is probably not feasible or desirable on a
foreign distro).

> This is no longer looks like a guix-topic, but compiz still segfaults
> after many errors for various SVGs, like:
> ```
> ERROR 2021-12-28 10:50:18 nux.gltexture.resource.manager
> GLTextureResourceManager.cpp:54 Invalid target, impossible to generate
> a new texture. Impossible to generate a pixbuf: Couldn’t recognize the
> image file format for file “/usr/share/unity/icons/search_spin.svg”
> ```
>
> `file` and the image viewer eog have no problem with
> “/usr/share/unity/icons/search_spin.svg”.
>
> There’s also
> ```
> compiz[8431]: WARN  2021-12-28 10:50:15 unity.glib.dbus.server 
> GLibDBusServer.cpp:595 Can't register object 'com.canonical.Unity.Dash' yet 
> as we don't have a connection, waiting for it...
> compiz[8645]: WARN  2021-12-28 10:50:18 unity.glib.dbus.server 
> GLibDBusServer.cpp:595 Can't register object 'com.canonical.Unity.Launcher' 
> yet as we don't have a connection, waiting for it...
> ```

Yeah, this doesn't look like something caused by guix, might be a side
effect or something though. The last two warnings are about compiz not
being able to communicate with Dash and Launcher from Unity over dbus.
But I don't use either Ubuntu or Unity so sadly I cannot be much of a
help here.


-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Foreign distro Unity desktop broken after guix update

2021-12-27 Thread Fredrik Salomonsson
Hi,

Thorsten Wilms  writes:
> Unity desktop stopped working after the first ’guix pull && guix
> package -u’ in maybe 2 weeks. There has been no update on the Ubuntu
> side between the last succesfull run and now, as far as I can tell.
> Unity desktop causes a few redraws, then exits back to the session
> greeter (lightdm).
>
> Now I would have assumed that there is no interaction between Unity and
> guix, since the former is entirely on the dpkg side. But via journalctl,
> I found a whole lot of:
> ```
> Dec 27 15:44:51 charly compiz[2198]: ERROR 2021-12-27 15:44:51
> nux.gltexture.resource.manager GLTextureResourceManager.cpp:
> 54 Invalid target, impossible to generate a new texture.
> Impossible to generate a pixbuf: Unable to load image-loading
> module:
> /gnu/store/2dza2psfbrrbvsni8jjqzzqx3hmm8kw8-librsvg-2.50.7/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so:
> /lib/x86_64-linux-gnu/libpthread.so.0: version `GLIBC_PRIVATE' not found
> (required by
> /gnu/store/2fk1gz2s7ppdicynscra9b19byrrr866-glibc-2.33/lib/librt.so.1)
> ```
>
> It looks like compiz segfaults shortly after a bunch of those, followed
> by unity7.service.
>
> Any ideas why dpkg-compiz tries to use guix-librsvg and what to do
> about it, or what else is going on here?

Could be that LD_LIBRARY_PATH is set and includs path(s) to
libpixbufloader-svg.so in the guix store which is causing the streams to
cross.

Try: 

printenv LD_LIBRARY_PATH

and see what it contains

or: 

env | grep /gnu/store

to see if any environment variable contains path to the store. 

Another reason why the runtime linker would pick up that library would
be if its path is added to the /etc/ld.so.conf configs. But I highly
doubt it's the issue.

If you want to go down the rabbit hole you can use the LD_DEBUG
environment variable to get some debug output. The libs option is
probably the most useful to you as that will print where it's looking
for stuff and why. Use:

env LD_DEBUG=libs LD_DEBUG_OUTPUT=/tmp/trace 

The LD_DEBUG_OUTPUT is a must as it will print out a ton of text. This
will save the output to /tmp/trace..

You can tell it to print out a help text by using:

env LD_DEBUG=help cat

I hope that helps a bit.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Logging and guix-home

2021-11-20 Thread Fredrik Salomonsson


Hi,

Sorry for the radio silence, it's been a busy week.

Hartmut Goebel  writes:

> Does setting #:log:file to /dev/stdout work for you? ((Just an idea, 
> I've not tested it)

Yes, it has the same behavior as not using #:log:file. And that is to
output everything to the first tty I log into. Which is the behavior I
would like to avoid, it makes the logging ephemeral and also hard to
read. As I have it to automatically spawn sway if I login on tty1.

Right now logging to a file kind of works, as I don't have many user
daemons running (only ssh-agent). And ssh-agent does not output that
much. One downside I don't have any timestamps in the log file or
anything like that. 

Gnupg was hard to convert as my foreign distro needs it and it ships
with systemd socket files which are enable by default. And I'm too lazy
to disable those in case I break something on my foreign distro.

So I've put the logging on the backburner. And I'll revisit it once I
have moved all my dotfiles over to guix home.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Logging and guix-home

2021-11-12 Thread Fredrik Salomonsson
Hi Guix,

I got a question how to setup logging for daemons that are controlled by
shepherd that guix home creates. First some background info.

I have been slowly migrating my dotfiles from a GNU stow setup to guix
home. I'm currently using guix on a foreign distro that uses systemd.
Where systemd was controlling my user level daemons, e.g. ssh-agent.

But now that I use guix home, I have migrated them to shepherd. With
that I lost the handy logging you get from systemd. To mitigate that for
shepherd I'm right now using the #:log-file parameter, as suggested in
this thread [1], to send the output to a file.

[1] https://lists.gnu.org/archive/html/help-guix/2019-04/msg00178.html

Here's how I've setup the ssh-agent

--8<
(define-public services
  (list
   (simple-service 'plt-ssh-environment
   home-environment-variables-service-type
   `(("SSH_AUTH_SOCK" . "${XDG_RUNTIME_DIR}/ssh-agent.socket")))
   (simple-service 'plt-ssh-agent
   home-shepherd-service-type
   `(
 ,(shepherd-service
   (provision '(ssh-agent))
   (documentation "Run and control ssh key agent.")
   (start #~(make-forkexec-constructor
 `("ssh-agent" "-D" "-a"
   ,(format #f "~a/ssh-agent.socket" (getenv 
"XDG_RUNTIME_DIR")))
 #:log-file (format #f "~a/ssh-agent.log" 
(getenv "XDG_LOG_HOME"
   (stop #~(make-kill-destructor)))
 
>8--

I do want some better logging, than just dumping to a file, as otherwise
I'll eventual run out of disk space. I have been pretty spoiled with
systemd on that part, and I have very little experience with syslog.
Given that I'm on a foreign distro, I cannot use the syslog-service (as
far as I know). Does anyone have a good idea on how to set this it up?

For example if I setup syslog and put "/dev/log" in the #:log-file
parameter, will it work? 

Or is syslog the wrong thing for user daemon logging? and instead I
should look for something else?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: no binary for interpreter `python' found in $PATH

2021-10-30 Thread Fredrik Salomonsson


Hi Ricardo,

Ricardo Wurmus  writes:

> Hi Fredrik,
>
>> (inputs `(("python" ,python)
> […]
>> patch-shebang: 
>> /gnu/store/ddqy6n4br1snnv57cxybdmycgyc2h01f-picmover-1.2.4/bin/picmover: 
>> warning: no binary for interpreter `python' found in $PATH
> […]
>> I've probably missed something obvious in my package definition 
>> but I
>> cannot see what. Shouldn't the inputs field add python to the 
>> $PATH?
>> Does anyone know what I'm missing?
>
> The “python” package only provides the “python3” executable, not 
> “python”.  The “python-wrapper” package is just like the “python” 
> package, except that it adds the “python” executable that upstream 
> does not include in the default build of Python.
>
> -- 
> Ricardo

Ah, that make sense. And switching to that, i.e

 (inputs `(("python" ,python-wrapper)

fixed the issue. Thank you for the help!

-- 
s/Fred[re]+i[ck]+/Fredrik/g



no binary for interpreter `python' found in $PATH

2021-10-30 Thread Fredrik Salomonsson


Hi Guix,

I'm trying to package up my simple python script for copying images from
my camera. But I'm encounter an issue when building, namely the
patch-shebangs phase does not find python and therefore skips patching
the shebang line.

Here's my definition
--8<
(define-module (plt packages photo)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages python)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages man)
  )

(define-public picmover
  (package
(name "picmover")
(version "1.2.4")
(source
 (origin
 (method git-fetch)
 (uri (git-reference
   (url "https://github.com/plattfot/picmover;)
   (commit (string-append "v" version
 (sha256
  (base32
   "1js9zlg2hzarkqwiadkmj7kk7dxvij2yjwlrf6xdbsa3ckym55yz"))
 (file-name (git-file-name name version
(build-system gnu-build-system)
(arguments
 '(#:tests? #f
   #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
   #:phases (modify-phases %standard-phases
  (delete 'configure
(native-inputs `())
(inputs `(("python" ,python)
  ("man-db" ,man-db)))
(propagated-inputs `(("python-pygobject" ,python-pygobject)
 ("gexiv2" ,gexiv2)))
(synopsis "Image and video importer/organizer")
(description
 "Moving pictures and videos from one location to another, using
metadata to determine camera maker, model, date and location. Useful
for importing files from a camera.")
(home-page "https://github.com/plattfot/picmover;)
(license license:gpl3+)))
>8--

I ran it with:

--8<

guix build -L ~/projects/plattfot-guix-channel/ picmover 

>8--

(it's in my custom channel at the moment)

In the output when building I see:

--8<
...
starting phase `patch-shebangs'
patch-shebang: 
/gnu/store/ddqy6n4br1snnv57cxybdmycgyc2h01f-picmover-1.2.4/bin/picmover: 
warning: no binary for interpreter `python' found in $PATH
phase `patch-shebangs' succeeded after 0.0 seconds
...
>8--

And double checking with the output and it is indeed unpatched.

--8<

head -1 $(guix build -L ~/projects/plattfot-guix-channel/ picmover)/bin/picmover
#! /usr/bin/env python

>8--

I've probably missed something obvious in my package definition but I
cannot see what. Shouldn't the inputs field add python to the $PATH?
Does anyone know what I'm missing?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Guix home on foreign distribution

2021-10-18 Thread Fredrik Salomonsson
Hi Roland,

Roland Everaert via  writes:

> Hello,
>
> Is there anything related to file and directory permissions to be set on 
> foreign distrubution for guix home to work?

No special permissions are needed for guix home to work. I'm using it on
a foregin distro and it works (still have some minor papercuts but
unrelated to this). 

> I know that feature is still pretty young and some parts are still in
> dev, yet I have tried it on my fedora 34 system and got the following
> error, which could be related to permission and file ownership:
>
> ---
>
> building /gnu/store/564yvkjmdp5bvdijk8w0cwl7ym5q6sdr-bash_profile.drv...
> Backtrace:
> 8 (primitive-load "/gnu/store/lp5wrbb8qi9lc3hyji3dxwjzgg8?")
> In ice-9/ports.scm:
> 463:17 7 (call-with-output-file _ _ #:binary _ #:encoding _)
> In ice-9/eval.scm:
> 159:9 6 (_ #(#(#) #))
> 163:9 5 (_ #(#(#) #))
> 155:9 4 (_ #(#(#) #))
> 159:9 3 (_ #(#(#) #))
> In ice-9/boot-9.scm:
> 152:2 2 (with-fluid* _ _ _)
> In ice-9/ports.scm:
> 440:11 1 (call-with-input-file "export HISTFILE=$HOME/.bash_his?" ?)
> In unknown file:
> 0 (open-file "export HISTFILE=$HOME/.bash_history" "r" # # ?)
>
> ERROR: In procedure open-file:
> In procedure open-file: No such file or directory: "export 
> HISTFILE=$HOME/.bash_history"
> builder for `/gnu/store/564yvkjmdp5bvdijk8w0cwl7ym5q6sdr-bash_profile.drv' 
> failed with exit code 1
> build of /gnu/store/564yvkjmdp5bvdijk8w0cwl7ym5q6sdr-bash_profile.drv failed
> View build log at 
> '/var/log/guix/drvs/56/4yvkjmdp5bvdijk8w0cwl7ym5q6sdr-bash_profile.drv.bz2'.
> cannot build derivation 
> `/gnu/store/ic73gayslzsj0k2snp61z5aaiwd6l5ck-files.drv': 1 dependencies 
> couldn't be built
> applying 2 grafts for 
> /gnu/store/g2wlw2kxszxclfq1pvxyfbs7q15xl1vf-python-future-0.18.2.drv ...
> cannot build derivation 
> `/gnu/store/gam06nxwyb6kcqs3pxwh1v8p627ps0df-home.drv': 1 dependencies 
> couldn't be built
> guix home: error: build of 
> `/gnu/store/gam06nxwyb6kcqs3pxwh1v8p627ps0df-home.drv' failed
>
> ---
>
> The guix home configuration file I use:
>
> -
>
> (use-modules (gnu home)
> (gnu home services)
> (gnu home services shells)
> (gnu services)
> (gnu packages admin)
> (gnu packages python-xyz)
> (gnu packages password-utils)
> (gnu packages dunst)
> (gnu packages disk)
> (gnu packages backup)
> (gnu packages libreoffice)
> (gnu packages guile)
> (gnu packages xdisorg)
> (gnu packages tls)
> (gnu packages vpn)
> (guix gexp))
>
> (home-environment
> (packages (list htop glances password-store dunst ranger restic hunspell
> ;; hunspell-dict-fr hunspell-dict-en
> ;; guile
> neofetch xdotool openssl openvpn xscreensaver))
> (services
> (list
> (service home-bash-service-type
> (home-bash-configuration
> (guix-defaults? #t)
> (bash-profile (list "export HISTFILE=$HOME/.bash_history"
>
> (simple-service 'test-config
> home-files-service-type
> (list `("config/test.conf"
> ,(plain-file "tmp-file.txt"
> "the content of ~/.config/test.conf")))
> -

I think this is an issue due to the api changed for the
home-bash-service-type and the docs hasn't been updated. See this email
thread [0]. Try changing:

(bash-profile (list "export HISTFILE=$HOME/.bash_history"))

to

(bash-profile (list (plain-file "bash_profile" "export 
HISTFILE=$HOME/.bash_history")))

[0] https://lists.gnu.org/archive/html/help-guix/2021-10/msg00045.html

I hope that helps.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Question about scripts in guix-home

2021-10-17 Thread Fredrik Salomonsson
Oleg Pykhalov  writes:

> Well, if you don't want to put the content of
> files/waybar/modules-mic.sh file inside a Scheme string, then you need
> to read the file to a string, e.g.:
> --8<---cut here---start->8---
> (simple-service 'shellcheck-wrapper
>home-files-service-type
>(list `("local/bin/shellcheck"
>,(computed-file
>  "shellcheck-wrapper"
>  #~(begin
>  (use-modules (ice-9 rdelim))
>  (with-output-to-file #$output
>(lambda ()
>  (display #$(with-input-from-file 
> "/tmp/foo" read-string
>  (chmod #$output #o555))
> --8<---cut here---end--->8---

I'm a bit confused, "Scheme string" and string aren't they the same
thing?

> Note that it's just an example which you should change according to your
> needs.  ;-)  Also, it creates not an executable but a symlink to an
> executable in a store, which I missed in a previous answer.

Thank you for the example! This looks like what I was looking for.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Question about scripts in guix-home

2021-10-16 Thread Fredrik Salomonsson


Hi,

Oleg Pykhalov  writes:

> I use the following, which creates ~/.local/bin/shellcheck executable file:
> --8<---cut here---start->8---
> (home-environment
>  ;; ...
>  (services
>   (list
>(simple-service 'shellcheck-wrapper
>home-files-service-type
>(list `("local/bin/shellcheck"
>,(computed-file
>  "shellcheck-wrapper"
>  #~(begin
>  (with-output-to-file #$output
>(lambda ()
>  (format #t "\
> #!/bin/sh
> exec -a \"$0\" ~a/bin/shellcheck --shell=bash \"$@\"\n"
>  #$shellcheck)))
>  (chmod #$output #o555)
> --8<---cut here---end--->8---

Thanks, still issue with the execution bit though…

This is what I tried. Note that I only tested this on my mic.sh script
to see if it worked.

#+begin_src scheme
  (define-public (get-services host)
"Return services for HOST."
(let ((storage-script (program-file
   "storage.sh"
   #~(execl #$(local-file 
"files/waybar/modules-storage.sh") "storage.sh"
  (list
   (simple-service 'plt-waybar-config
   home-files-service-type
   `(
 ("config/waybar/config"
  ,(local-file (format #f "~a/files/waybar/~a.conf" 
%source-dir host)))
 ("config/waybar/style.css"
  ,(local-file (format #f 
"~a/files/waybar/~a-style.css" %source-dir host)))
 ("config/waybar/modules/mic.sh"
  ,(computed-file
"mic-wrapper"
#~(begin
(let ((script #$(local-file 
"files/waybar/modules-mic.sh")))
  (with-output-to-file #$output
(lambda ()
  (format #t "\
  #!/bin/sh
  exec -a \"$0\" ~a --shell=bash \"$@\"\n"
  script)))
  (chmod script #o555)) ;; <-- trying to chmod 
the script
(chmod #$output #o555
 ("config/waybar/modules/storage.sh"
  ,storage-script)
 )
#+end_src


Without the (chmod script #o555), it builds but when I try and run it I
get: 

#+begin_src bash
  $ ~/.config/waybar/modules/mic.sh
  /home/plattfot/.config/waybar/modules/mic.sh: line 2: 
/gnu/store/kbarnh2z2zaljwy6bwfhni2h3jjihzyj-modules-mic.sh: Permission denied
  /home/plattfot/.config/waybar/modules/mic.sh: line 2: exec: 
/gnu/store/kbarnh2z2zaljwy6bwfhni2h3jjihzyj-modules-mic.sh: cannot execute: 
Permission denied
#+end_src

If I try and chmod the script, as shown in the example above, guix home
fails with:

#+begin_src bash
  $ guix home reconfigure -L ~/.files ~/.files/plt/home/configs/surt.scm
 1
  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/mn3ii78ri2bsi47rjc5qwnjc7hrd0znn-home.drv
 /gnu/store/3fwk9l6xjgkac702figgn4ppfmlli5xh-files.drv
 /gnu/store/jydir36k5b53n6wqnjzbkgkjz7wjw1g8-mic-wrapper.drv
  building /gnu/store/jydir36k5b53n6wqnjzbkgkjz7wjw1g8-mic-wrapper.drv...
  Backtrace:
 2 (primitive-load "/gnu/store/w399i13mijh528x6ymlijh0k5fz?")
  In ice-9/eval.scm:
  619:8  1 (_ #f)
  In unknown file:
 0 (chmod "/gnu/store/kbarnh2z2zaljwy6bwfhni2h3jjihzyj-mo?" ?)

  ERROR: In procedure chmod:
  In procedure chmod: Operation not permitted
  builder for `/gnu/store/jydir36k5b53n6wqnjzbkgkjz7wjw1g8-mic-wrapper.drv' 
failed with exit code 1
  build of /gnu/store/jydir36k5b53n6wqnjzbkgkjz7wjw1g8-mic-wrapper.drv failed
  View build log at 
'/var/log/guix/drvs/jy/dir36k5b53n6wqnjzbkgkjz7wjw1g8-mic-wrapper.drv.bz2'.
  cannot build derivation 
`/gnu/store/3fwk9l6xjgkac702figgn4ppfmlli5xh-files.drv': 1 dependencies 
couldn't be built
  cannot build derivation 
`/gnu/store/mn3ii78ri2bsi47rjc5qwnjc7hrd0znn-home.drv': 1 dependencies couldn't 
be built
  guix home: error: build of 
`/gnu/store/mn3ii78ri2bsi47rjc5qwnjc7hrd0znn-home.drv' failed
#+end_src

I ended up just package them up and that seems to be working

#+begin_src scheme
  (define-module (plt home waybar)
#:use-module (gnu home services)
#:use-module (gnu packages bash)
#:use-module (gnu packages wm)
#:use-module (gnu services)
#:use-module (guix build-system copy)

Re: Question about scripts in guix-home

2021-10-16 Thread Fredrik Salomonsson
Edouard Klein  writes:

> Hi,
>
> Sorry I can't be more precise due to lack of time, but maybe invoking
> chmod on the .sh files in a gexp would work ?
>
> https://www.gnu.org/software/guile/manual/html_node/File-System.html
>
> #+begin_quote
>
> Scheme Procedure: chmod object mode
> C Function: scm_chmod (object, mode)
>
> Changes the permissions of the file referred to by object. object
> can be a string containing a file name or a port or integer file
> descriptor which is open on a file (in which case fchmod is used as
> the underlying system call). mode specifies the new permissions as a
> decimal number, e.g., (chmod "foo" #o755). The return value is
> unspecified.
>
> #+end_quote.
>

Yeah, not sure how I should invove it though. I tried doing 

(chmod #$(local-file "files/waybar/modules-mic.sh") #o555)

In different gexp. But just getting operation not permitted:

#+begin_src text
  In different gexp but just getting:

   Backtrace:
 2 (primitive-load "/gnu/store/w399i13mijh528x6ymlijh0k5fz?")
  In ice-9/eval.scm:
  619:8  1 (_ #f)
  In unknown file:
 0 (chmod "/gnu/store/kbarnh2z2zaljwy6bwfhni2h3jjihzyj-mo?" ?)

  ERROR: In procedure chmod:
  In procedure chmod: Operation not permitted
#+end_src

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Question about scripts in guix-home

2021-10-15 Thread Fredrik Salomonsson


Hi guix,

I decided to try out guix home. But I hit a bit of a snag. I'm trying to
port my waybar config over to it, but cannot figure out how to set the
execution bit on my two custom scripts I have.

This is what I currently have:

#+begin_src scheme
  (define-module (plt home waybar)
#:use-module (gnu services)
#:use-module (gnu home services)
#:use-module (gnu packages wm)
#:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (ice-9 format))

  (define-public packages
(list
 waybar
 ))

  (define %source-dir (current-source-directory))

  (define-public (get-services host)
"Return services for HOST."
(list
 (simple-service 'plt-waybar-config
 home-files-service-type
 `(
   ("config/waybar/config"
,(local-file (format #f "~a/files/waybar/~a.conf" 
%source-dir host)))
   ("config/waybar/style.css"
,(local-file (format #f "~a/files/waybar/~a-style.css" 
%source-dir host)))
   ("config/waybar/modules/mic.sh"
,(local-file "files/waybar/modules-mic.sh"))
   ("config/waybar/modules/storage.sh"
,(local-file "files/waybar/modules-storage.sh"))
   
#+end_src

Which generates the config but the mic.sh and storage.sh bash scripts
are missing their execution bit.

The bash scripts are really basic, for example here's the mic.sh:

#+begin_src bash
  #! /usr/bin/env bash

  mic_mute=$(pactl get-source-mute @DEFAULT_SOURCE@| cut -d" " -f2)
  if [[ "$mic_mute" == "yes" ]]
  then
  echo '{"text": "",  "class": "muted", "percentage": 0 }'
  else
  echo '{"text": "",  "class": "unmuted", "percentage": 100}'
  fi
#+end_src

I played around with gexp but didn't get anything working. Closest I got
what by using program-file

#+begin_src scheme
  (define-public (get-services host)
"Return services for HOST."
(let ((mic-script (program-file
   "mic.sh"
   #~(execl #$(local-file "files/waybar/modules-mic.sh") 
"mic.sh")))
  (storage-script (program-file
   "storage.sh"
   #~(execl #$(local-file 
"files/waybar/modules-storage.sh") "storage.sh"
  (list
   (simple-service 'plt-waybar-config
   home-files-service-type
   `(
 ("config/waybar/config"
  ,(local-file (format #f "~a/files/waybar/~a.conf" 
%source-dir host)))
 ("config/waybar/style.css"
  ,(local-file (format #f 
"~a/files/waybar/~a-style.css" %source-dir host)))
 ("config/waybar/modules/mic.sh"
  ,mic-script)
 ("config/waybar/modules/storage.sh"
  ,storage-script)
 )
#+end_src

But it's still trying to execute the original scripts and fail due to
the execution bit.

I'm probably missing something obvious, but I haven't used gexp before.

How do you set the execution bit on a file-like object? 

Or is there a better approach for dealing with these? Package them up
perhaps? As I just realized when writing this that I also need to patch
the shebang to point to the bash guix-home is using.

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Guix on the MNT Reform

2021-09-06 Thread Fredrik Salomonsson
Fredrik Salomonsson  writes:

> I'm building the image with:
> #+begin_src shell
> guix environment guix
> ./pre-inst-env guix system image --image-type=mnt-reform2-raw  config.scm
> #+end_src
>
> I tried with the =linux-libre-arm64-generic= first but that couldn't
> find the =sdhci-esdhc-imx= module. And now when I'm testing with just
> the linux-libre kernel I'm running out of space on my =/tmp=. Is there
> an easy way of telling the guix-daemon to use another path for building?
> Or do I need to restart it and change its =TMPDIR=?

Just to follow up, I got a bit further by changing the =TMPDIR= to a
directory in my home directory. I'm using guix on a foreign distro so I
just did a quick edit on the systemd service file:

#+begin_src shell
mkdir /home/plattfot/scratch
sudo systemctl stop guix-daemon.service
sudo systemctl edit guix-daemon.service
#+end_src

#+begin_src conf
[Service]
Environment=TMPDIR=/home/plattfot/scratch
#+end_src

#+begin_src shell
sudo systemctl start guix-daemon.service
#+end_src

It now fails when building the info-dir

#+begin_src shell
building directory of Info manuals...
builder for `/gnu/store/qv4mh2hvryj33qyi0cw4nzbgy1l17xv6-info-dir.drv' failed 
with exit code 1
build of /gnu/store/qv4mh2hvryj33qyi0cw4nzbgy1l17xv6-info-dir.drv failed
View build log at 
'/var/log/guix/drvs/qv/4mh2hvryj33qyi0cw4nzbgy1l17xv6-info-dir.drv.bz2'.
cannot build derivation 
`/gnu/store/g1lqn7h5baxq8grv2k2kjrjdvkpxlzn7-profile.drv': 1 dependencies 
couldn't be built
cannot build derivation 
`/gnu/store/wybzgz18szsrnk5rayyxgh3hvsqrg6mg-system.drv': 1 dependencies 
couldn't be built
cannot build derivation 
`/gnu/store/kp5086frygpvfmlyb2wa78shgciwvd4p-partition.img.drv': 1 dependencies 
couldn't be built
cannot build derivation 
`/gnu/store/3g9fqz36rw1pqzdh35ds3vnpgidqk40y-genimage.cfg.drv': 1 dependencies 
couldn't be built
cannot build derivation 
`/gnu/store/gazkm0vdj2i6iw7i0r8d1hlr02aqglpm-disk-image.drv': 1 dependencies 
couldn't be built
guix system: error: build of 
`/gnu/store/gazkm0vdj2i6iw7i0r8d1hlr02aqglpm-disk-image.drv' failed
#+end_src

The build log is empty, so I'm not sure what went wrong.

Sadly that's all the time I have for this today. I'll see if I can find
some time during the rest of week, otherwise I'll continue on the
weekend.

NOTE: to undo the changes on the service file you can simply run:
#+begin_src shell
sudo systemctl revert guix-daemon.service
#+end_src

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Guix on the MNT Reform

2021-09-06 Thread Fredrik Salomonsson
m-trusted-firmware-rk3399)
  ,@(package-native-inputs base))
 
+(define-public u-boot-mnt-reform2
+  (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu"))
+(commit "bdcdce7434b9db19aabd59181014f24d66af0db8"))
+(package
+  (inherit base)
+  (version "2021.06")
+  (name "u-boot-mnt-reform2")
+  (source (origin
+(method git-fetch)
+(uri (git-reference
+  (url 
"https://source.mnt.re/reform/reform-boundary-uboot.git;)
+  (commit commit)))
+(file-name (git-file-name name version))
+(sha256
+ (base32
+  "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3"))
+(snippet
+ '(copy-file "mntreform-config" ".config"
+  (arguments
+(substitute-keyword-arguments (package-arguments base)
+  ((#:phases phases)
+   `(modify-phases ,phases
+  (delete 'configure
+
 (define-public vboot-utils
   (package
 (name "vboot-utils")
diff --git a/gnu/system/images/mnt-reform2.scm 
b/gnu/system/images/mnt-reform2.scm
new file mode 100644
index 00..1d1df1383e
--- /dev/null
+++ b/gnu/system/images/mnt-reform2.scm
@@ -0,0 +1,66 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Fredrik Salomonsson 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu system images mnt-reform2)
+  #:use-module (gnu bootloader)
+  #:use-module (gnu bootloader u-boot)
+  #:use-module (gnu image)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu services)
+  #:use-module (gnu services base)
+  #:use-module (gnu services networking)
+  #:use-module (gnu system)
+  #:use-module (gnu system file-systems)
+  #:use-module (gnu system image)
+  #:use-module (srfi srfi-26)
+  #:export (mnt-reform2-barebones-os
+mnt-reform2-image-type
+mnt-reform2-barebones-raw-image))
+
+(define mnt-reform2-barebones-os
+  (operating-system
+(host-name "sarimner")
+(timezone "Canada/Pacific")
+(locale "en_US.utf8")
+(bootloader (bootloader-configuration
+ (bootloader u-boot-mnt-reform2-bootloader)
+ (targets '("/dev/mmcblk1"
+(initrd-modules '("sdhci-esdhc-imx"))
+(kernel linux-libre-arm64-generic)
+(file-systems (cons (file-system
+  (device (file-system-label "my-root"))
+  (mount-point "/")
+  (type "ext4"))
+%base-file-systems))
+(services (append (list (service dhcp-client-service-type))
+  %base-services
+
+(define mnt-reform2-image-type
+  (image-type
+   (name 'mnt-reform2-raw)
+   (constructor (cut image-with-os
+ (arm64-disk-image (* 4 (expt 2 20))) ;4MiB
+ <>
+
+(define mnt-reform2-barebones-raw-image
+  (image
+   (inherit
+(os->image mnt-reform2-barebones-os #:type mnt-reform2-image-type))
+   (name 'mnt-reform2-barebones-raw-image)))
+
+mnt-reform2-barebones-raw-image
#+end_src

And I'm using this config to create the image:
#+begin_src scheme
(use-modules (gnu)
 (gnu bootloader u-boot)
 (gnu packages bootloaders)
 (gnu packages linux)
 (gnu packages)
 (gnu services nfs)
 (gnu services sddm)
 (gnu system locale)
 (gnu system nss)
 (ice-9 rdelim)
 (ice-9 format)
 (srfi srfi-1))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs shells xdisorg display-managers)

(define plattfot
  (user-account
   (name "plattfot")
   (group "users")
   ;; Define a G-Expr to find the path of the zsh binary:
   ;; 
https://gitlab.com/rain1/guix-wiki/wikis/FAQ#how-do-i-make-my-login-shell-zsh
   ;;(shell #~(string-append #$zsh "/bin/zsh"))
   (supplementary-groups '("wheel" "netdev" "audio" "video"))
   (home-directory "/home/platt

Re: Guix on the MNT Reform

2021-09-06 Thread Fredrik Salomonsson
Christine Lemmer-Webber  writes:

>> Cool!  Hope it gets up and running soon.

Thanks, I got it running somewhat. My batteries are still a bit messed
up after I accidentally let it drain them too low. I ordered a battery
charger so hopefully I can get them in great shape again.

>> In the meanwhile, some local notes...
>>
>> It looks like the relevant info to get going is here:
>>
>>   https://mntre.com/reform2/handbook/advanced.html#system-boot
>>
>> There's a script to compile a custom u-boot:
>>
>>   
>> https://source.mnt.re/reform/reform-system-image/-/blob/main/reform2-imx8mq/mkuboot.sh
>>
>> #+BEGIN_SRC bash
>> if [ ! -d u-boot ]
>> then
>>   echo "Cloning U-Boot..."
>>   git clone --depth 1 https://source.mnt.re/reform/reform-boundary-uboot.git 
>> u-boot
>> fi
>>
>> cd u-boot
>> cp mntreform-config .config
>>
>> export CROSS_COMPILE=aarch64-linux-gnu-
>> export ARCH=arm
>>
>> # build rescue u-boot first (loads kernel from eMMC)
>> make -j$(nproc) flash.bin KCPPFLAGS='-DMNTREFORM_BOOT_EMMC'
>> cp flash.bin flash-rescue.bin
>>
>> # build normal u-boot second (loads kernel from SD card)
>> make -j$(nproc) flash.bin
>>
>> cd ..
>> #+END_SRC
>>
>> So that doesn't look to complicated.
>>
>> Here's the custom u-boot:
>>
>>   https://source.mnt.re/reform/reform-boundary-uboot
>>
>> It says:
>>
>>   "Fork of the vendor (Boundary Devices) u-boot for Reform 2, with
>>   minor tweaks. The goal is to migrate to mainstream u-boot or barebox
>>   ASAP. The main impediment so far is the 4GB RAM config."
>>
>> So we probably want to make a u-boot-mnt-reform in
>> gnu/packages/bootloaders.scm
>>
>> So we probably want to use "guix system image" and then add:
>>
>>   gnu/system/images/mnt-reform.scm
>>
>> Ideally in the end we should be able to do:
>>
>>   guix system image --image-type=mnt-reform my-os.scm
>>
>> So yeah, the rest of the pieces to figuring it out seem to be all here:
>>
>>   https://mntre.com/reform2/handbook/advanced.html#system-boot
>>
>> It *seems* like this should all be possible...
>>
>>  - Christine

Thanks for the notes! I've just been poking around in the guix source
code to get a grasp how it works plus reading the Guix on an ARM Board
by Julien Lepiller [0]

[0] https://guix.gnu.org/blog/2019/guix-on-an-arm-board/

>
> Here's the progress I've made so far:
>
> #+BEGIN_SRC diff
> diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
> index 2889a90d54..17a7abc657 100644
> --- a/gnu/packages/bootloaders.scm
> +++ b/gnu/packages/bootloaders.scm
> @@ -953,6 +953,38 @@ to Novena upstream, does not load u-boot.img from the 
> first partition.")
> `(("firmware" ,arm-trusted-firmware-rk3399)
>   ,@(package-native-inputs base))
>  
> +(define-public u-boot-mnt-reform2
> +  (let ((base (make-u-boot-package "mnt-reform2" "aarch64-linux-gnu"))
> +(commit "bdcdce7434b9db19aabd59181014f24d66af0db8"))
> +(package
> +  (inherit base)
> +  (version "2021.06")
> +  (name "u-boot-mnt-reform2")
> +  (source (origin
> +(method git-fetch)
> +(uri (git-reference
> +  (url 
> "https://source.mnt.re/reform/reform-boundary-uboot.git;)
> +  (commit commit)))
> +(file-name (git-file-name name version))
> +(sha256
> + (base32
> +  "1pwmcaaxx5zvn26gznwz4rjki4w3wwfzdnipxfr7d8067fmwgjp3"
> +  (arguments
> +(substitute-keyword-arguments (package-arguments base)
> +  ((#:phases phases)
> +   `(modify-phases ,phases
> +  (replace 'configure
> +(lambda _
> +  (copy-file "mntreform-config" ".config")))
> +  
> +  ;; Phases do not succeed on the bl31 ELF.
> +  #;(delete 'strip)
> +  #;(delete 'validate-runpath)
> +  #;(native-inputs
> +   `(("firmware" ,arm-trusted-firmware-rk3399)
> + ,@(package-native-inputs base
> +))
> +
>  (define-public vboot-utils
>(package
>  (name "vboot-utils")
> #+END_SRC
>
> However, I hit this error when trying to compile:
>
> #+BEGIN_VERBATIM
> starting phase `build'
>   HOSTCC  scripts/basic/fixdep
> In file included from 
> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdlib.h:9:0,
>  from scripts/basic/fixdep.c:112:
> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/malloc.h:875:22:
>  error: missing binary operator before token "("
>  #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
>   ^
> In file included from scripts/basic/fixdep.c:113:0:
> /gnu/store/dj05znzsk7fq43zj5r719ll8ldgh9xxi-u-boot-mnt-reform2-2021.06-checkout/include/stdio.h:18:14:
>  error: expected declaration specifiers or '...' before numeric constant
>  int __printf(1, 2) printf(const char *fmt, ...);
>   ^
> 

Re: Guix on the MNT Reform

2021-08-17 Thread Fredrik Salomonsson
Hi Chris,

Christine Lemmer-Webber  writes:

> Hi!  Well my MNT Reform arrived.  I'd like to start putting Guix on it
> but I'm kind of low on time right now...

I got mine last week!

> I wonder if anyone else has started making progress towards this?

> What I'd love: a tutorial that says "here are the steps to make an sd
> card you can boot your reform with"!

I'm planning to start hacking on that once I've found a NVMe that works.
The XPG SX8200 Pro 1TB I bought for it had serious issues with access
times. Next up is to buy a WD Blue SN550 1TB and hopefully that will
work.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: meson needs certain version

2021-08-09 Thread Fredrik Salomonsson


Hi,

Andy Tai  writes:

> Hi, I am trying to create package definition for some specific package
> and it uses meson for build.   When I try to guix build the package,
> it fails with
>
> meson.build:1:0: ERROR: Meson version is 0.53.2 but project requires >= 0.54
>
> I find meson later than 0.53.2 in guix already, but how in package
> definition to specify to use a particular meson version?  Thanks
>

I use something like this in my guix.scm for a package that uses meson
and requires a version newer than 0.53.2

---8<---
(use-modules
  (guix build-system meson)
  …
  (gnu packages build-tools)
  )

(define-public foo
  (package
…
(build-system meson-build-system)
(arguments
 `(#:meson ,meson-0.55))
…
))
--->8---

Note that the defintion of meson-0.55 in the build-tools.scm has the
comment

;; Added temporarily for packages that need it.
;; TODO: Remove when core-updates is merged.
(define-public meson-0.55
…
)

So it might be safer to use meson-next to avoid breakage if/when
meson-0.55 gets removed.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: failed to compute the derivation for Guix

2021-03-24 Thread Fredrik Salomonsson
Leo Famulari  writes:
> This looks like bugs #47157 / #47266:
>
> https://bugs.gnu.org/47157
> https://bugs.gnu.org/47266
>
> If so, it's a transient networking error caused by problems in Guix
> fixed in more recent versions. You'll need to retry `guix pull` until it
> succeeds and then restart guix-daemon.
>
> Let us know how it goes!

That was it! I justed needed to try 6 more times to have it go through :).

Here's what I did, which is just add a loop around the solution in
https://bugs.gnu.org/47266

---8<---
try=1; while ! guix pull;\
do echo "Attempt $(( try++ )) failed, try again"; \
done && echo "Attempt $try succeeded!" && systemctl restart guix-daemon
--->8---

Thanks!

-- 
s/Fred[re]+i[ck]+/Fredrik/g



failed to compute the derivation for Guix

2021-03-23 Thread Fredrik Salomonsson
Hi,

I've been having issues updating guix the last few days. My laptop went
through after a couple of tries but doesn't seemed to work with my
desktop.

Hitting this error when running `sudo -i guix pull`:
---8<---
Backtrace:
In guix/ui.scm:
  2164:12 19 (run-guix-command _ . _)
In guix/scripts/substitute.scm:
652:2 18 (guix-substitute . _)
In unknown file:
  17 (with-continuation-barrier #)
In ice-9/boot-9.scm:
  1736:10 16 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
  15 (apply-smob/0 #)
In ice-9/boot-9.scm:
  1736:10 14 (with-exception-handler _ _ #:unwind? _ # _)
  1736:10 13 (with-exception-handler _ _ #:unwind? _ # _)
  1731:15 12 (with-exception-handler # ?)
In guix/scripts/substitute.scm:
   701:17 11 (_)
410:7 10 (process-substitution _ "/gnu/store/w7ilyzvlzlv0mqjrv8?" ?)
In ice-9/boot-9.scm:
  1736:10  9 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/substitute.scm:
419:9  8 (_)
In ice-9/boot-9.scm:
  1731:15  7 (with-exception-handler # ?)
  1669:16  6 (raise-exception _ #:continuable? _)
  1667:16  5 (raise-exception _ #:continuable? _)
  1669:16  4 (raise-exception _ #:continuable? _)
  1764:13  3 (_ #< components: (#<> #)
  1669:16  2 (raise-exception _ #:continuable? _)
  1667:16  1 (raise-exception _ #:continuable? _)
/  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Throw to key `bad-response' with args `("Bad Response-Line: ~s" (""))'.
Backtrace:
   1 (primitive-load "/gnu/store/4wab2nqaavbgkd94rmzqahcw1m2?")
In guix/ui.scm:
  2164:12  0 (run-guix-command _ . _)

guix/ui.scm:2164:12: In procedure run-guix-command:
Throw to key `bad-response' with args `("Bad Response-Line: ~s" (""))'.
@ substituter-failed 
/gnu/store/w7ilyzvlzlv0mqjrv89bb5nhr8ajf27h-guix-daemon-1.2.0-17.ec7fb66  
fetching path 
`/gnu/store/w7ilyzvlzlv0mqjrv89bb5nhr8ajf27h-guix-daemon-1.2.0-17.ec7fb66' 
(empty status: '')
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
-Backtrace:
  14 (primitive-load 
"/gnu/store/lx1fy4svkv1avz60k7ddjsy59sjycwqk-compute-guix-derivation")
In ice-9/eval.scm:
155:9 13 (_ _)
159:9 12 (_ #(#(#(#(#(#(#(#(#(#(#(#(#(# 
?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?))
In ice-9/boot-9.scm:
152:2 11 (with-fluid* _ _ _)
In ./guix/store.scm:
  2066:24 10 (run-with-store # _ 
#:guile-for-build _ #:system _ #:target _)
   1900:8  9 (_ _)
In ./guix/gexp.scm:
   256:18  8 (_ _)
   1136:2  7 (_ _)
   1002:2  6 (_ _)
849:4  5 (_ _)
In ./guix/store.scm:
  1948:12  4 (_ #)
   1362:5  3 (map/accumulate-builds # _ _)
  1373:15  2 (_ # _ _)
   719:11  1 (process-stderr # _)
In ./guix/serialization.scm:
 80:6  0 (read-int #)

./guix/serialization.scm:80:6: In procedure read-int:
ERROR:
  1. :
  file: #f
  port: #
guix pull: error: You found a bug: the program 
'/gnu/store/lx1fy4svkv1avz60k7ddjsy59sjycwqk-compute-guix-derivation'
failed to compute the derivation for Guix (version: 
"d0429747deb3efcce567c94ac74ac3a48b0f0bd6"; system: "x86_64-linux";
host version: "15b39826ffef7adae2adff459264bfdc5362f320"; pull-version: 1).
Please report it by email to .
--->8---

---8<---
sudo -i guix describe   
 1
Generation 42   mar 13 2021 10:03:26(current)
  guix 15b3982
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 15b39826ffef7adae2adff459264bfdc5362f320
--->8---

I've seen a few others on the mailing list having similar issues. But
nothing seems to fix it for me. I've tried `sudo -i guix gc`, moved the
/root/.config/guix directory.

Anyone know what could be wrong?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Setting up guix source tree for testing a package

2021-03-17 Thread Fredrik Salomonsson
Hi Zelphir,

Zelphir Kaltstahl  writes:

> This definitely is helpful!

Glad I could be of some help :).

> I'm sorry for the delay in responding. Thank you for your efforts!

No worries.

> I hit other errors when leaving away the --pure and I have the suspicion, that
> gnu-build-system requires me to have a configure script in the git tree of my
> repository, which I did not know before I saw it failing with a 127 error on
> calling a configure script, which is/was not commited in my repository. I will
> probably have to revise a section somewhere in my guile-hall packaging guide, 
> to
> note, that one should add the configure script, even though it is generated 
> by hall.

Hmm, the bootstrap phase in gnu-build-system should invoke
`autoreconf -vif` if the package contains either a `configure.ac` or
`configure.in` and does not contain a `bootstrap`, `bootstrap.sh` or
`autogen.sh`. At least that what I get from reading the source:
gnu-build-system.scm:203 [0]

[0] 
https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/gnu-build-system.scm

I also ran it on one of my projects that are using guile-hall, which
does not have a configure script and it build it just fine.

Maybe you have one of those bootstrap scripts that does not generate a
configure script?

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: setup c/c++ development environment

2021-03-14 Thread Fredrik Salomonsson


Ekaitz Zarraga  writes:

> So the workflow with guix build is not very good for development but
> for CI and stuff like that because you are going to rebuild everything.

That pretty much sums it up.

> Thanks for the explanations.

No problem.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Setting up guix source tree for testing a package

2021-03-11 Thread Fredrik Salomonsson


Hi Zelphir,

Zelphir Kaltstahl  writes:

> Hello Guix Users,
>
> I am trying to set up GNU Guix for package testing, as I want to test a 
> package
> before sending in a patch to add it to GNU Guix.
>
> I'll describe the steps I am taking and where I am seeing them in the docs in
> the following.
>
> All is happening inside a VM, which runs a Debian 10. The VM is almost fresh,
> except for guest additions and git and vim and such things.
>
>
> I start at https://guix.gnu.org/manual/en/html_node/Packaging-Guidelines.html
> , wherein 
> I
> find a link to https://guix.gnu.org/manual/en/html_node/Defining-Packages.html
> .
>
> Next the packaging guidelines tell me, that I may run for example:
>
> 
> ./pre-inst-env guix build gnew --keep-failed
> 
>
> inside the Guix build tree.
>
> I clone Guix, so that I have a source tree of Guix.
>
> I define my package inside `guix/gnu/packages/guile.scm`.
>
> In packaging guidelines, there is a link to
> https://guix.gnu.org/manual/en/html_node/Running-Guix-Before-It-Is-Installed.html
> .
> I am supposed to run the test inside a fresh Guix, to make sure, that the
> package will work fine for others, if I understand correctly.
>
> On
> https://guix.gnu.org/manual/en/html_node/Running-Guix-Before-It-Is-Installed.html
> 
> I am told, that I need to generate a pre-installation script to run guix 
> without
> installing it (running stuff in the Guix build tree, as far as I understand). 
> To
> generate it, I need Guix again. The docs direct me to
> https://guix.gnu.org/manual/en/html_node/Building-from-Git.html
> .
>
> On https://guix.gnu.org/manual/en/html_node/Building-from-Git.html
>  the dilemma 
> is
> finally uncovered, that I need Guix to build the pre-installation script, to 
> use
> that, to build a package in the Guix source tree.
>
> As you can see, there is a chicken-and-egg problem: you first need to have
> Guix installed. Typically you would install Guix System (see System
> Installation) or Guix on top of another distro (see Binary Installation); in
> either case, you would verify the OpenPGP signature on the installation 
> medium.
> This “bootstraps” the trust chain.
>
> I install it.

You don't need guix to build guix, it just makes it a lot easier to
setup the environment to build guix as you don't need to hunt for its
dependencies yourself.

> Then I run:
>
> 
> guix environment guix --pure
> 
>
> The docs tell me I have to run:
>
> 
> ./bootstrap
> ./configure --localstatedir=some_directory
> 
>
> But here I am facing a problem. I have no clue what to set the
> `--localstatedir=directory` to. The docs tell me it is important, but I see no
> instructions on how to choose a directory for the local state, when I have
> already a Guix installed (binary installation on foreign distro). The linked
> docs about the https://guix.gnu.org/manual/en/html_node/The-Store.html
>  do not help me
> choosing it either, because that page is about the store itself, not about my
> specific scenario of doing things from Guix source tree. Since I intend to 
> build
> a package inside the Guix source tree, I think it should exactly _not_ be 
> /var,
> as that would conflict with the Guix installation, that I had to do to create
> the pre-inst-env script.
>
> What is the idea for the local state directory? Is it the location of a
> temporary store, which will contain anything, that I produce using the
> pre-inst-env script? That is what I am guessing. In that case I think
> `localstoredir` might be a good alias for `localstatedir`.
>
>
> I am trying with an empty directory, which I create just for that purpose, on
> the same level as the cloned Guix repository:
>
> 
> $ tree -L 2
> .
> ├── guix
> │   ├── ABOUT-NLS
> │   ├── aclocal.m4
> │   ├── AUTHORS
> │   ├── autom4te.cache
> │   ├── bootstrap
> │   ├── build-aux
> │   ├── ChangeLog
> │   ├── CODE-OF-CONDUCT
> │   ├── config-daemon.ac
> │   ├── config.log
> │   ├── config.status
> │   ├── configure
> │   ├── configure.ac
> │   ├── COPYING
> │   ├── doc
> │   ├── etc
> │   ├── gnu
> │   ├── gnu.scm
> │   ├── guix
> │   ├── guix.scm
> │   ├── HACKING
> │   ├── INSTALL
> │   ├── m4
> │   ├── Makefile
> │   ├── Makefile.am
> │   ├── Makefile.in
> │   ├── NEWS
> │   ├── nix
> │   ├── po
> │   ├── pre-inst-env
> │   ├── README
> │   ├── ROADMAP
> │   ├── scripts
> │   ├── test-env
> │   ├── tests
> │   ├── THANKS
> │   └── TODO
> └── guix-store
> 
>
> So I run:
>
> 
> ./configure 

Re: setup c/c++ development environment

2021-03-11 Thread Fredrik Salomonsson


Hi Ekaitz,

CC:ing the rest of the help-guix mailing list, I hope you don't mind.

Ekaitz Zarraga  writes:

> I have a question with all this you shared.
>
> Is this compiling only the needed parts or it recompiles the whole directory 
> from scratch every time you run `guix build`?

To my knowledge it will recompile everything every time you run
`guix build`.

So this method might be better suited for CI (continuous integration).

But benefit with the `guix.scm` file is that you can also use the same
file to setup the environment you need to build your package.

`guix environment -l guix.scm`
or
`guix environment -l build-aux/guix.scm`

Depending how you have layed out the guix.scm file.

That will use guix to setup the environment needed to build the your
package. And in that shell you can use:

meson build
meson compile -C build
meson test -C build

Or equivalent for other build systems. Which will support partial
builds.

Note that guix might have issues with build generated files for some
build systems when mixing guix environment and guix build. E.g. run
`guix environment`, generate the build files and then run `guix build`.
It seems fine with meson, even when not filtering out the build files.
But I have had issues with GNU autotools and permissions,
`make distclean` before calling `guix build` is a quick workaround. A
better option is probably to filter out those files when collecting the
source.

I hope that answers your question.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: setup c/c++ development environment

2021-03-04 Thread Fredrik Salomonsson


Hi Roy,

Roy Lemmon  writes:

> I would like to setup a c/c++ development environment on guix. At the moment, 
> I
> have used gcc-toolchain to bring in the compiler etc. Are other pieces
> necessary ?

That would be the bare minimum for c/c++. I would recommend using a
build system to build your stuff like GNU autotools[0], cmake[1] or
meson[2].

[0] 
https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html
[1] https://cmake.org/cmake/help/latest/
[2] https://mesonbuild.com/Tutorial.html

For the ease of use I would recommend meson.

A cool thing I learned from the Guix days last year was from the talk
"Just build it with Guix" by Efraim Flashner [3]. And that was using
guix to do the testing. It works really well.

[3] 
https://xana.lepiller.eu/guix-days-2020/guix-days-2020-efraim-flashner-build-it-with-guix.mp4

Here is a simplified template of what I use for C++. It uses meson to
build and googletest[4] as the testing framework. But it should be
fairly simple to change to autotools or cmake or another testing
framework, e.g. catch2 [5].

[4] https://github.com/google/googletest/blob/master/docs/primer.md
[5] https://github.com/catchorg/Catch2/blob/devel/docs/why-catch.md#top

---8<---
(use-modules
  (guix build-system meson)
  (guix gexp)
  (guix git-download)
  (guix packages)
  (guix utils)
  ((guix licenses) #:prefix license:)
  (gnu packages pkg-config)
  (gnu packages check)
  (gnu packages build-tools)
  (gnu packages gcc)
  (ice-9 popen)
  (ice-9 rdelim)
  )

;; From the talk "Just build it with Guix" by Efraim Flashner
;; presented on the Guix days 2020
;; https://guix.gnu.org/en/blog/2020/online-guix-day-announce-2/
(define %source-dir (dirname (current-filename)))

(define %git-commit
  (read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f2" 
OPEN_READ)))

(define (skip-git-and-build-directory file stat)
  "Skip the `.git` and `build` directory when collecting the sources."
  (let ((name (basename file)))
(not (or (string=? name ".git")
 (string=? name "build")

(define-public package-name-here
  (package
(name "package-name-here")
(version (git-version "0.1.0"  "HEAD" %git-commit))
(source (local-file %source-dir
#:recursive? #t
#:select? skip-git-and-build-directory))
(build-system meson-build-system)
(arguments
 `(#:meson ,meson-0.55
   ;; Pass flags to meson
   ;; #:configure-flags '("-Dinstall=true")
   ))
(native-inputs `(("pkg-config" ,pkg-config)
 ("googletest" ,googletest)
 ("gcc" ,gcc-9)))
(synopsis "Template for building with meson.")
(description "Simple template for building with meson-0.55 and gcc-9. Using
googletest as the testing framework.")
;; (home-page "https://...;)
(license license:gpl3+)
))

package-name-here
-->8

To use it, simply copy the template above into a file called guix.scm,
update the package-name-here and version accordingly and place it at the
root of your project. Note the trailing `package-name-here` at end of
the template, which is there to return a package definition to guix.

Then you can run:

  guix build -f guix.scm

That build your project and run the tests.

If you want to place the guix.scm in a subdirectory, say build-aux.
Change 
  (define %source-dir (dirname (current-filename)))
to
  (define %source-dir (dirname (current-source-directory)))

In the template above.

After that you just run it with

  guix build -f build-aux/guix.scm

I hope that helps.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Yet another locale question on a foreign distro

2021-01-31 Thread Fredrik Salomonsson
Hi Julien,

Julien Lepiller  writes:

> Does gpg-agent change the locale of the system somehow? What's the locale it 
> launches the pinentry with?

Kind of, it request the pinentry program to at least set LC_CTYPE and
LC_MESSAGES to the requested locale. Currently my pinentry-rofi ignore
these requests. I implemented them in case that was the issue, but still
the same issue. It was requesting to set en_US.UTF-8, e.g. my default
locale.

> Does it exist in $GUIX_LOCPATH?

It does, however you gave me a point in the right direction. The issue
was that the systemd gpg-agent.service unit that launches gpg-agent,
does not set $GUIX_LOCPATH. Which was why rofi failed to set the locale.

To fix it all I needed to do was to append that to the service file.

I.e run.
  systemctl --user edit gpg-agent.service

and add:
  [Service]
  Environment=GUIX_LOCPATH=%h/.guix-profile/lib/locale

Thanks for the help!

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Yet another locale question on a foreign distro

2021-01-30 Thread Fredrik Salomonsson


Hi guix,

I've developed a little tool to use rofi as a pinentry for gpg-agent
called pinentry-rofi. It recently landed in guix, note that version
2.0.2 that is the latest in guix only works if you don't have guile in
the same profile.

My current setup is guix running on a foreign distro (Arch Linux). And
I'm currently running pinentry-rofi installed by its package manager and
it works fine. When I submitted the patch to guix, I only ran the tests
and launched the tool from the commandline to make sure it was working.
I never did test it with gpg-agent. Which was a mistake on my part, as
it seems it does not work with gpg-agent when it's installed via guix.

I tracked down the root of the problem to rofi not being able to set the
locale. The error it return is

Rofi-WARNING **: 21:16:03.115: Failed to set locale

As far as I can tell my locale is setup properly. GUIX_LOCPATH is set to
the profile I have `glibc-locales` installed to. And rofi has no issue
setting the locale when I launch pinentry-rofi from the commandline.
It's only when gpg-agent launches it.

I've tried to use both the native gpg package on the foreign distro as
well as the gnupg package on guix (installed to the same profile as
pinentry-rofi). Same issue on both.

If I hardcode LC_ALL=C, when pinentry-rofi launches rofi, it works with
gpg-agent. But that does not seem like a great solution.

Do anyone have any idea what could be the issue?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Emacs use-package: Guix backend?

2020-12-19 Thread Fredrik Salomonsson


Hi Ricardo,

Ricardo Wurmus  writes:

> I recently moved all my Emacs packages to a separate profile, which is
> controlled by a manifest that’s generated from my init.org configuration
> file.  I like this, because I can separately upgrade packages from my
> main profile and keep my Emacs configuration self-contained.
>
> What still annoys me, though, is that package installation is separate
> from configuration.  I don’t really want to be forced to update the
> manifest at the top of my init.org before I can configure the package
> somewhere at the bottom of the init.org.
>
> The “use-package” macro was designed to allow for both installation and
> configuration in the same place.  By default it uses package.el to
> install packages when they aren’t available yet.  I’d like to use
> “use-package”, but I’d like it to install packages with Guix and also
> install to a separate Guix profile, preferably via a manifest.
>
> Package managers are supposed to override “use-package-ensure-function”
> and/or “use-package-pre-ensure-function” to use something other than
> package.el.
>
> Before I embark on this journey, do any of you have travel reports to
> share?

My 2 cents.

I got multiple profiles; one for emacs, nyxt, git and guile for example.
I wrote a small bash script to make it easy for me to upgrade all of
them or just a subset. What I like about this is that upgrading emacs
and all of its packages are the same as upgrading any of the other
profiles. I.e. I don't have to remember to run
`list-packages` -> `U` -> `x` to update my emacs packages anymore. Plus
I get the bonus of anything goes wrong I can just rollback the emacs
profile.

My emacs manifest is completely decoupled from my configuration. There
are potential of them becoming out of sync. But in practice I haven't
notice anything of that. I haven't found it annoying (yet) to update my
emacs manifest before adding the configuration. Mostly because my
package configuration has been quite stable. It's just recently I've
been starting testing some new packages (after seeing all the cool stuff
from the emacsconf).

> Do you think this is worth doing?

Yes, would be great to have use-package directly feed the manifest and
have some tighter coupling between the configuration and guix.

There are some speed bumps that I can see, one being for example
emacs-flymake-shellcheck does not give you shellcheck so in my manifest
I list both emacs-flymake-shellcheck and shellcheck for that to work.
Maybe keyword-extension[0] can handle cases like these? I.e. you have a
keyword where you can specify external dependencies. Something like:

(use-package flymake-shellcheck
  :guix-install '("shellcheck"))

[0] https://github.com/jwiegley/use-package/tree/master#keyword-extensions

Also, at least for me, I would still like to be able to upgrade/rollback
the emacs profile together with the rest of guix. Instead of that being
yet another step to update your whole system.

> If so, where could we add this feature so that all Guix users benefit
> from it? Emacs-Guix?

That is a good question :). Emacs-Guix seems like a good fit to me as it
already has the logic to talk to guix from emacs.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Problem building disk-image with guix from git

2020-09-25 Thread Fredrik Salomonsson
Hi guix,

See if I can send this to the right mailing list this time...

I thought I would test out the patch from https://issues.guix.info/43366
on my laptop. I cloned the guix repo (checksum: d48b17a), applied the
patch from 43366. Then followed the steps in the manual:
```
$ guix environment guix
$ ./bootstrap
$ ./configure --localstatedir=/var
$ make
```

Then launched the daemon in one shell:
```
$ sudo -E ./pre-inst-env guix-daemon --build-users-group=guixbuild
```

And tried to build the disk image in another
```
$ ./pre-inst-env guix system disk-image --file-system-type=iso9660 
gnu/system/install.scm
```

But getting this error:
```
substitute: Backtrace:
substitute: In ice-9/boot-9.scm:
substitute:   3223:13 19 (_)
substitute: In ice-9/threads.scm:
substitute: 390:8 18 (_ _)
substitute: In ice-9/boot-9.scm:
substitute:   3507:20 17 (_)
substitute:2806:4 16 (save-module-excursion _)
substitute:   3527:26 15 (_)
substitute: In unknown file:
substitute:   14 (primitive-load-path "guix/store" #)
substitute: In guix/store.scm:
substitute:  23:0 13 (_)
substitute: In ice-9/boot-9.scm:
substitute:3380:4 12 (define-module* _ #:filename _ #:pure _ #:version _ # 
_ …)
substitute:   3393:24 11 (_)
substitute:222:29 10 (map1 (((guix utils)) ((guix config)) ((guix #)) ((…)) 
…))
substitute:222:29  9 (map1 (((guix config)) ((guix deprecation)) ((guix …)) 
…))
substitute:222:29  8 (map1 (((guix deprecation)) ((guix memoization)) ((…)) 
…))
substitute:222:29  7 (map1 (((guix memoization)) ((guix serialization)) (#) 
…))
substitute:222:29  6 (map1 (((guix serialization)) ((guix monads)) ((# #)) 
…))
substitute:222:29  5 (map1 (((guix monads)) ((guix records)) ((guix #)) (#) 
…))
substitute:222:29  4 (map1 (((guix records)) ((guix base16)) ((guix #)) (#) 
…))
substitute:222:29  3 (map1 (((guix base16)) ((guix base32)) ((gcrypt #)) # 
…))
substitute:222:29  2 (map1 (((guix base32)) ((gcrypt hash)) ((guix #)) (#) 
…))
substitute:222:17  1 (map1 (((gcrypt hash)) ((guix profiling)) ((rnrs #)) # 
…))
substitute:3300:6  0 (resolve-interface (gcrypt hash) #:select _ #:hide _ # 
_ …)
substitute: 
substitute: ice-9/boot-9.scm:3300:6: In procedure resolve-interface:
substitute: no code for module (gcrypt hash)
guix system: error: `/home/plattfot/projects/guix/scripts/guix substitute' died 
unexpectedly
```

I tried running the guix system command in a guix enviroment:
```
$ guix environment guix --ad-hoc guile guild-gcrypt
```

Same error.

This is what changed when I applied the patch:
```
$ git diff
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 419c10195b..cd43c14eab 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -365,6 +365,16 @@ verbose output to the LOG port."
 stat
 lstat)))

+(define-syntax-rule (warn-on-error expr file)
+  (catch 'system-error
+(lambda ()
+  expr)
+(lambda args
+  (format (current-error-port)
+  "warning: failed to delete ~a: ~a~%"
+  file (strerror
+(system-error-errno args))
+
 (define* (delete-file-recursively dir
   #:key follow-mounts?)
   "Delete DIR recursively, like `rm -rf', without following symlinks.  Don't
@@ -375,10 +385,10 @@ errors."
 (or follow-mounts?
 (= dev (stat:dev stat
   (lambda (file stat result)   ; leaf
-(delete-file file))
+(warn-on-error (delete-file file) file))
   (const #t)   ; down
   (lambda (dir stat result); up
-(rmdir dir))
+(warn-on-error (rmdir dir) dir))
   (const #t)   ; skip
   (lambda (file stat errno result)
 (format (current-error-port)
```

Anyone have any pointers what I might have done wrong?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Guix on the MNT Reform

2020-09-14 Thread Fredrik Salomonsson


Hi Andreas,

Andreas Enge  writes:

> Are there other Guix users who ordered such a machine?

I was debating it back and forth after I saw the first email from
Christopher. And a week or so before they reached their goal I took the
plunge and ordered one. Should be a fun laptop to hack on.


-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Guix completion in Emacs

2020-06-14 Thread Fredrik Salomonsson


Hi,

Ricardo Wurmus  writes:

> This works for me.
>
> $ guix describe
> Generation 47 6月 05 2020 23:22:46 (current)
>   guix ecab53c
> repository URL: https://git.savannah.gnu.org/git/guix.git
> branch: master
> commit: ecab53c320b1584a08f811b17a92bd9a50a50ff3
>
> $ readlink -f $(which emacs)
> /gnu/store/vx8fzbwb4cw8dlh760y2336sd2pw0kvy-emacs-26.3/bin/emacs

I'm getting the same error. On a foreign distro with emacs-next.

$ guix describe
Generation 7jun 12 2020 17:14:42(current)
  guix 9ae4bd0
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 9ae4bd0b77db21d3e352560511d974bcc15df5db
$ readlink -f $(which emacs)
/gnu/store/8z8wnqjy9frxpvpg7jzlj5v77yy20fhn-emacs-next-27.0.91-0.c36c5a3/bin/emacs

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: Questions about guix handling emacs packages

2020-06-11 Thread Fredrik Salomonsson


Hi Alexey,

Alexey Abramov  writes:

> AFAIK emacs-ts is failing on check. There are couple of PRs in the upstream:
>
> https://github.com/alphapapa/ts.el/pull/9
> https://github.com/alphapapa/ts.el/pull/8

Strange, it built fine for me with guix commit:
ba6d3612550f5d978c4b5b1df122444f8fb29377. Maybe those checks aren't fatal?

> Regarding the magit highlighting, emacs 27 has a new face attribute
> :extend. You can read about the issue here 
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37774
>
> ,[ C-h i d m emacs s :extend ]
> |This is one of the few faces that has the ‘:extend t’ attribute by
> | default, which implies that the same face is used to highlight the text
> | and space between end of line and the window border.  To highlight only
> | the text you could set this attribute to ‘nil’.
> `

Nice, did not know about the :extend attribute.

> Magit fix is on the master already 
> https://github.com/magit/magit/commit/891ebdca58ef498ff3b94c8ac2921cc6b72c3d25
>
> In the meantime you can do something like this:
>
> --8<---cut here---start->8---
> (dolist (face '(magit-diff-hunk-heading
>   magit-diff-hunk-heading-highlight
>   magit-diff-hunk-heading-selection
>   magit-diff-hunk-region
>   magit-diff-lines-heading
>   magit-diff-lines-boundary
>   magit-diff-conflict-heading
>   magit-diff-added
>   magit-diff-removed
>   magit-diff-our
>   magit-diff-base
>   magit-diff-their
>   magit-diff-context
>   magit-diff-added-highlight
>   magit-diff-removed-highlight
>   magit-diff-our-highlight
>   magit-diff-base-highlight
>   magit-diff-their-highlight
>   magit-diff-context-highlight
>   magit-diff-whitespace-warning
>   magit-diffstat-added
>   magit-diffstat-removed
>   magit-section-heading
>   magit-section-heading-selection
>   magit-section-highlight
>   magit-section-secondary-heading
>   magit-diff-file-heading
>   magit-diff-file-heading-highlight
>   magit-diff-file-heading-selection))
> (set-face-attribute face nil :extend t))
> --8<---cut here---end--->8---

This seems to be fixed in the version of guix I'm using. I don't have
that issue anymore and I'm using emacs 27 and magit from guix.

--
s/Fred[re]+i[ck]+/Fredrik/g



Re: Questions about guix handling emacs packages

2020-06-02 Thread Fredrik Salomonsson


Hi Maxim,

Maxim Cournoyer  writes:

>> Question regarding the emacs-xyz.scm. I see it is divided into four
>> different categories; Emacs hacking, Web browsing, Multimedia and
>> Miscellaneous. But what is the order for the package definitions in
>> those categories?
>
> Ha, I had forgotten myself that the emacs-xyz module was organized in
> such sections (shame!).  In any way, I don't think the order of the
> package definitions matter much.  I usually use whatever is most logical
> (group tightly related packages), otherwise alphabetically.

Ok, thanks. Then I'll try and place them where I think they'll fit.
Worst case someone will just move them to a better place.



Re: Questions about guix handling emacs packages

2020-06-02 Thread Fredrik Salomonsson
Hi Zimoun,

zimoun  writes:

> Yes and no. :-)
> You can see for example this blog entry [1].
>
> [1] https://guix.gnu.org/blog/2017/creating-bundles-with-guix-pack/

Thanks for the link. Will give guix pack a try when I'm back at my
machine at work. Right now I'm working from home so I don't need to have
emacs on my work machine. Tramp covers that bit for me.

>> > Is it fixed now for you?
>>
>> emacs-magit - yes. emacs-ts is still failing.
>
> Could you open a bug report for this?

I was too slow :). Did a `guix pull` and updated to
86a03090afa711dfa2f141caee820b66d7942bc3 and it is now fixed. Will
create a bug report for emacs-lua-mode and emacs-ledger-mode as those
two are still broken for me.

Thanks again for all your help.



Re: Questions about guix handling emacs packages

2020-06-01 Thread Fredrik Salomonsson
Hi Zimoun,

zimoun  writes:

> I do not know what rofi is but re-sourcing is faster to check is the
> new change works than any other. :-)

It is just an application launcher, but yes re-sourcing is a bit faster.
:)

> Nice!  Thank you for your contribution.
> As you can seen, add Emacs packages is in general fun and rewarding. :-)
> Do not hesitate to report your difficulties on mailing lists help-guix
> or guix-devel or IRC #guix.

Thank you. Indeed it was. I'm still learning the ropes but got some good
feedback from my first contribution. So I'll continue adding the rest of
the emacs packages that I'm missing.

> Yes, "guix pack" is an an option if your work machine run the Linux
> kernel.  Otherwise, it should be a bazooka to kill a tiny fly. :-)

I'm quite lucky that my work machine is also running the linux kernel.
Although a quite outdated one, it predates user namespaces support. But
yeah, `guix pack` might be a bit overkill.

> However, the main advantage to use for producing your Emacs setup is
> that it is harder to break it and when it did, you can (almost) always
> roll-back.  For example, I track (git) the channel that I used: guix
> describe -f channels > foo.scm && git commit -a and I use manifests
> files tracked too.  Therefore, I can easily use the same setup on
> another machine running Guix or restore previous setup without keeping
> all the generations in the store.  Anyway. :-)

Nice, that is a pretty nice way of having it reproducible. Which my
setup with use-package is not. It is easy to deploy but not to reproduce
it and rolling back is non-existent. So guix ticks all the boxes for me
:).

> Is it fixed now for you?

emacs-magit - yes. emacs-ts is still failing.



Re: Questions about guix handling emacs packages

2020-05-31 Thread Fredrik Salomonsson


Hi,

Maxim Cournoyer  writes:

> I'm not sure why that could be, but I merged a newer version of Magit
> recently.  If you guix pull now and upgrade your packages, you should
> get the new one.

Just did a pull, upgrade my packages and now magit works as expected.
Thanks!

> I also can recommend to stick to using just Emacs packages from Guix,
> and contributing the missing ones you encounter (as you found out, it's
> relatively simple, and fun! :-)).  This way you are sure to use packages
> that were byte compiled for your Emacs version.

Yeah, that's the path I'm going to take to avoid future headaches. And I
just got my first contribution merged into guix (yay!). I got some
feedback on what I did wrong. Which I'll try and not to repeat in the
coming package definitions I'm planing to make (cargo (the emacs mode),
flymake-shellcheck, glsl-mode and meson-mode).

Question regarding the emacs-xyz.scm. I see it is divided into four
different categories; Emacs hacking, Web browsing, Multimedia and
Miscellaneous. But what is the order for the package definitions in
those categories?

--
s/Fred[re]+i[ck]+/Fredrik/g



Re: Questions about guix handling emacs packages

2020-05-29 Thread Fredrik Salomonsson
Hi,

zimoun  writes:

> Re-source the profile seems enough. :-)

True, although I usually launch my programs from rofi and I haven't
figured out how to re-source the environment for that.

> Feel free to give a try and report on help-guix or guix-devel or #guix
> your progress or you are stuck.

Thanks, I just sent a patch for adding emacs-buffer-move. Figured I
start with one and see how that goes. Then follow with the rest.

Really digging the git send-email workflow.

> I am using emacs@26.3, for comparison.
> And Guix 2c8305d14 which is one month older.

>
> I am using  emacs-lua-mode@20191204-1.1f596a9 and I do not have such
> issue.  But I remember something similar and it was coming from
> init.el file; at the time my Emacs packages was loaded with
> 'use-package' and now they are loaded with 'with-eval-after-load'.
> Well, I do not remember exactly, sorry.

Yeah, my errors are probably due to I'm using emacs-next (27.0.91) and
`use-package`. And I still need the ability for emacs to download all my
packages as I don't have access to guix on my work machine. Although I'm
toying with the idea of using `guix pack' to deploy emacs on my work
machine.

>> - emacs-org-super-agenda:
>
> Thank you for the report.  As you can see with the Data Service, it
> seems that a regression has been introduced.
>
> https://data.guix.gnu.org/repository/1/branch/master/package/emacs-ts/output-history
> https://data.guix.gnu.org/repository/1/branch/master/package/emacs-ts/derivation-history
>
> The log corresponding is:
>
> http://ci.guix.gnu.org/log/k45l3rcrr81qwkh6w9l0b1gsn6xbm2jd-emacs-ts-0.1-2.395649a
>
> and as you have noticed, the test 'ts-update' fails.
>
>
> Hum? The regression is probably introduced by commit 4ef89d884.

Oh, did not know about the data service. Thanks for pointing that out. I
did a `guix import elpa -a melpa-stable -r ts` and that built fine. So
maybe just update emacs-ts from 0.1 to 0.2 will fix the issue.

>> - emacs-magit:
> I am using it and I not see what you are seeing.  But I am not using
> an older Guix than b2d35dd9a.

Probably an issue that I'm using emacs 27 instead of emacs 26.

>> - emacs-ledger-mode:
>
> I did not try.

No worries.

Anyways thanks for all the help!

--
s/Fred[re]+i[ck]+/Fredrik/g



Questions about guix handling emacs packages

2020-05-23 Thread Fredrik Salomonsson
Hi,

Thought I should try letting guix handle the emacs packages. And overall it
worked out great. But encounter some minor issues along the way, so I
thought I should ask.

1) The manual mention that packages installed via guix will be picked up by
emacs from the EMACSLOADPATH which is set when emacs is installed. That was
not the case for me. I needed to manually set:

export EMACSLOADPATH=$GUIX_PROFILE/share/emacs/site-lisp:$EMACSLOADPATH

for it to work.  I'm running guix on a foreign distro and I'm using
emacs-next. Is one of those the reason for it?

2) Not all packages I use in emacs are packaged up in guix (yet). And some
did not work properly for me. So I still need to rely on emacs to install
some of the packages. The issue is, that it doesn't seem that emacs knows
about the packages installed via guix when it comes to installing packages.
Even though it can load them just fine.

For example emacs-dash which I have installed via my manifest but is also
one that gets installed by emacs. If I run emacs -Q and then M-x
describe-package dash. It gives me

Package dash is dependency.

 Status: Installed in ‘dash-20200426.2244/’ (unsigned).
Version: 20200426.2244
Summary: A modern list library for Emacs
Required by: ts-20191010.210, org-super-agenda-20200310.1337,
magit-20200522.1028, ht-20200217.2331, git-commit-20200516.2016
   Keywords: lists
 Maintainer: Magnar Sveen 
 Author: Magnar Sveen 
Other versions: 20200426.2244 (melpa), 2.17.0 (melpa-stable), 2.12.0 (gnu).

If I remove my elpa directory in my user-emacs-directory where emacs
installs the packages. It wont find dash when I do describe-package. But if
I run (require 'dash) it will find and load dash. Unsetting EMACSLOADPATH
and it will fail to find dash.

Is this the expected behavior? From what I can tell from reading the manual
[1], external packages must be listed in `package-directory-list` and have
the same layout as the one installed in elpa. Which is not the case when
installing via guix, as everything is symlinked to
$GUIX_PROFILE/share/emacs/site-lisp.

I hope this isn't too much off topic and apologize if any of this has been
asked before (I couldn't find the answer when searching the mailing list
archive).

Thanks

1:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Files.html#Package-Files
-- 
s/Fred[re]+i[ck]+/Fredrik/g
(use-package-modules
 fonts
 emacs
 emacs-xyz
 cmake
 finance
 shellutils
 haskell-apps)

(packages->manifest
  (list
font-hack
glibc-locales
emacs-next
emacs-s
emacs-dash
emacs-company
emacs-yasnippet
emacs-highlight-symbol
emacs-haskell-mode
emacs-smartparens
emacs-jinja2-mode
emacs-rust-mode
emacs-go-mode
emacs-cmake-mode
emacs-geiser
emacs-toml-mode
emacs-yaml-mode
emacs-json-mode
emacs-markdown-mode
emacs-julia-mode
emacs-systemd-mode
emacs-lua-mode
emacs-ledger-mode
emacs-gnuplot
emacs-magit
emacs-transient
emacs-ag
emacs-pdf-tools
emacs-telega
emacs-vterm
emacs-libmpdel
emacs-mpdel
emacs-nginx-mode
emacs-org
emacs-emms
emacs-ivy
emacs-wgrep
emacs-tramp
emacs-sudo-edit
emacs-evil
emacs-emojify
emacs-rainbow-mode
emacs-move-text
emacs-expand-region
emacs-multiple-cursors
emacs-string-inflection
emacs-nov-el
emacs-guix
emacs-lsp-mode
emacs-eglot
emacs-direnv
;; External tools used by emacs
direnv
shellcheck
))


Re: no sway.desktop file for GDM

2019-10-21 Thread Fredrik Salomonsson
> Efraim Flashner  writes:

> > Sway does create a sway.desktop in %out/share/wayland-sessions. The
> > problem is that our GDM currently doesn't support wayland. Others who
> > are using sway are using SDDM in place of GDM.

Ah, should have searched a little bit better. Thanks for the
clarification. I'll look into setting up SDDM.

--
s/Fred[re]+i[ck]+/Fredrik/g



no sway.desktop file for GDM

2019-10-21 Thread Fredrik Salomonsson
Hi Guix,

Is there a reason why the sway package doesn't create a sway.desktop file
in *out*/share/wayland-sessons for GDM? I see that most X tiling wms create
on in *out*/share/xsessons.

I tried adding one myself by copying the code from herbstluftwm and modify
it but got stuck on permissions when I tried to run guix built from my
local clone. So before I continue debugging that I though I would ask.

Thanks
-- 
s/Fred[re]+i[ck]+/Fredrik/g


Re: How add user without update package

2019-07-11 Thread Fredrik Salomonsson
No problem

One tip to avoid long build hours is the find a commit with enough
substitutes.
What I usually do is to check http://cl.guix.info/jobset/guix-master, find
one with success > 1000 and pull down that commit.
For example #6182 guix → 156b7ab  1322/620/1268
run: guix pull --committ=156b7ab
Not a foolproof way of avoiding building the heavy packages but works good
enough for me right now. Not fun when you need to build icecat and the
whole rust build chain.

There is also this that was mentioned a while back on the mailing list:
https://lists.gnu.org/archive/html/help-guix/2019-02/msg00018.html
Haven't tested it myself but looks promising.



Den tors 11 juli 2019 kl 06:48 skrev Pirboazo :

> Hi Fredrik,
>
> As you see below the state of my system  before my reconfigure.
>
> last guix pull :
>
> Generation 5*Jun 30 2019 15:39:18 *   (current)
>  guix 5dd0269
> repository URL: https://git.savannah.gnu.org/git/guix.git
> branch: master
> commit: 5dd0269244da42066133d19055c9eb82b9e9ae20
>
> Last reconfigure :
>
> Generation 6   * Jul 01 2019 00:19:25*(current)
>   file name: /var/guix/profiles/system-6-link
>   canonical file name: /gnu/store/yq8ww08f2sh5277hw081ycsyhg5i4qid-system
>   label: GNU with Linux-Libre 5.1.15
>   bootloader: grub
>   root device: UUID: 2cab8a75-2dbf-4d03-afb0-58377abeee0e
>   kernel:
> /gnu/store/mxnxz8n6hdm6dndw8biqqqzblrmvc4ia-linux-libre-5.1.15/bzImage
>
> Yesterday when i launch a reconfigure .
>
> guix download app and rebuild webkitgtk -2.2.24  on my laptop this take
> several hours --> generation 7..
>
> After  create the new generation when i launch an another reconfigure all
> work fine..  --> generation 8
>
> And now it work fine.
>
> Thank you
>
> Regards
>
> Pierre
>
>
> On 7/10/19 11:35 PM, Fredrik Salomonsson wrote:
>
> Hi Pierre,
>
> Den ons 10 juli 2019 kl 12:17 skrev Pirboazo :
>
>> Hello Everybody,
>>
>> I want add an user on my system but not update all packages.
>>
>> An user on on IRC channel #guix said me :
>>
>> > just use the same commit as you did when you last reconfigured with
>> the modified config.scm's only change in the users section
>>
>> I don't understand how to launch reconfigure with the same commit.
>>
>> i understand  to change the commit , i must use the command :  guix pull
>>
>> If i don't modify the commit
>>
>> How  it'spossible than the command *guix system reconfigure* launch the
>> build of a new configuration.
>>
>> Thank for your help.
>>
>> Pierre
>>
>
> It is as simple as running
> `guix system reconfigure /path/to/config.scm`.
>
> That will reconfigure your os using the config file based on the current
> commit of guix.
>
> Only way to change the commit, as you said, is `guix pull`.
>
> Which is why when updating Guix System. You first run `guix pull`, to
> get new versions of packages etc. Then `guix system reconfigure` to
> reconfigure your os based on that commit.
>
> I hope that clears it up.
> --
> s/Fred[re]+i[ck]+/Fredrik/g
>
>

-- 
s/Fred[re]+i[ck]+/Fredrik/g


Re: How add user without update package

2019-07-10 Thread Fredrik Salomonsson
Hi Pierre,

Den ons 10 juli 2019 kl 12:17 skrev Pirboazo :

> Hello Everybody,
>
> I want add an user on my system but not update all packages.
>
> An user on on IRC channel #guix said me :
>
> > just use the same commit as you did when you last reconfigured with
> the modified config.scm's only change in the users section
>
> I don't understand how to launch reconfigure with the same commit.
>
> i understand  to change the commit , i must use the command :  guix pull
>
> If i don't modify the commit
>
> How  it'spossible than the command *guix system reconfigure* launch the
> build of a new configuration.
>
> Thank for your help.
>
> Pierre
>

It is as simple as running
`guix system reconfigure /path/to/config.scm`.

That will reconfigure your os using the config file based on the current
commit of guix.

Only way to change the commit, as you said, is `guix pull`.

Which is why when updating Guix System. You first run `guix pull`, to
get new versions of packages etc. Then `guix system reconfigure` to
reconfigure your os based on that commit.

I hope that clears it up.
-- 
s/Fred[re]+i[ck]+/Fredrik/g


Re: btrfs raid configuration vs mdraid

2019-05-21 Thread Fredrik Salomonsson


Hi Giovanni,

Giovanni Biscuolo  writes:

[...]

>>> Assuming I'm going to format the root filesystem as:
>>>
>>>   mkfs.btrfs -m raid1 -d raid1 /dev/sda3 /dev/sdb3
>>>
>>> how should I configure (file-system...)? this way:
>>>
>>> (file-system
>>>   (mount-point "/")
>>>   (type "btrfs")
>>>   (device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb")))
>>>
>>> with UUID taken from "lsblk -f"?
>>
>> That should work.
>
> I confirm it worked, easily! :-)

Good to know :).

[...]

>> One thing you should note is that guix might generate incorrect
>> paths for grub if you are using subvolumes. At least guix < 1.0 does
>> that for me, haven't tested 1.0+ yet. But I have been using a shell
>> script that works around that issue.
>
> I did not use root on a subvolume for my installation, but I'll try to
> reproduce it in a test install: can you please file a bug report for
> this, IMHO this should be fixed

Looks like there is already a bug report on this:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33517

And I just tested to reconfigure my system with guix v1.0.1 and the
issue is still there.

>>> From you experience is RAID on brtfs as solid as the one on mdadm?
>>
>> I have very little experience with mdadm, so can only speak of my
>> experience with btrfs and RAID-1. Which I have been using for 3+ years.
>> For me it has been solid. Only issue I have encountered was when my
>> fileserver lost power a few times leaving the filesystem corrupt. A
>> "btrfs check --repair" fixed that issue.
>
> Thanks for sharing! You give me courage to adopt btrfs more extensively
> :-)

Glad I could help out.

--
s/Fred[re]+i[ck]+/Fredrik/g



Re: btrfs raid configuration vs mdraid

2019-05-20 Thread Fredrik Salomonsson

Hi Giovanni,

Giovanni Biscuolo  writes:

> Hello Guix!
>
> My preferred storage setup until now was using RAID-1 software RAID
> built with mdadm; for a new machine I'm considering setting up a RAID-1
> btrfs volume as root, but I have much less experience with btrfs
>
> Assuming I'm going to format the root filesystem as:
>
>   mkfs.btrfs -m raid1 -d raid1 /dev/sda3 /dev/sdb3
>
> how should I configure (file-system...)? this way:
>
> (file-system
>   (mount-point "/")
>   (type "btrfs")
>   (device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb")))
>
> with UUID taken from "lsblk -f"?

That should work. Creating a label will also work and might be easier to
handle as you won't need to update the config file incase you reformat your
disks. One thing you should note is that guix might generate incorrect
paths for grub if you are using subvolumes. At least guix < 1.0 does
that for me, haven't tested 1.0+ yet. But I have been using a shell
script that works around that issue.

> From you experience is RAID on brtfs as solid as the one on mdadm?

I have very little experience with mdadm, so can only speak of my
experience with btrfs and RAID-1. Which I have been using for 3+ years.
For me it has been solid. Only issue I have encountered was when my
fileserver lost power a few times leaving the filesystem corrupt. A
"btrfs check --repair" fixed that issue.

--
s/Fred[re]+i[ck]+/Fredrik/g



fix-grub.sh
Description: Script for fixing broken paths in grub after guix reconfigure
;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu)
 (gnu packages)
 (gnu system nss)
 (gnu system locale)
 (gnu services nfs)
 (ice-9 rdelim)
 (ice-9 format))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs shells xdisorg)

(define plattfot
  (user-account
   (name "plattfot")
   (group "users")
   ;; Define a G-Expr to find the path of the zsh binary:
   ;; 
https://gitlab.com/rain1/guix-wiki/wikis/FAQ#how-do-i-make-my-login-shell-zsh
   ;;(shell #~(string-append #$zsh "/bin/zsh"))
   (supplementary-groups '("wheel" "netdev" "audio" "video"))
   (home-directory "/home/plattfot")))

;; Specify a mapped device for the encrypted root partition.
;; The UUID is that returned by 'cryptsetup luksUUID'.
(define mapped-root
  (mapped-device
   (source (uuid "ab43f8be-1a18-4999-836d-71dac382dfb5"))
   (target "root")
   (type luks-device-mapping)))

(define mapped-swap
  (mapped-device
   (source (uuid "9f04f917-efd3-4036-b3f5-24705fee7ffa"))
   (target "swap")
   (type luks-device-mapping)))

;; Partion layout for /dev/mapper/root
;; under __current/
;; | subvol  | Mountpoint   | Comment| Shared   |
;; |-+--++--|
;; | arch-root   | /| root for Arch  | no   |
;; | guixsd-root | /| root for GuixSD| no   |
;; | grub| /boot/grub   | grub config| yes  |
;; | guix| /var/guix| guix stuff | yes  |
;; | gnu | /gnu | Store etc  | yes  |
;; | home| /home| home partition | yes  |

(define btrfs-common-options
  '("defaults" "discard" "compress=lzo" "space_cache" "autodefrag"))

(define (btrfs-mount-options subvol)
  "Return the btrfs mount options I use.
   Where SUBVOL is the subvolume to mount"
  (string-join `(,@btrfs-common-options ,(format #f "subvol=~a" subvol)) ","))

(define fs-root
  (file-system
   (mount-point "/")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/guixsd-root"))
   (needed-for-boot? #t)
   (dependencies `(,mapped-root

(define fs-grub
  (file-system
   (mount-point "/boot/grub")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/grub"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-gnu
  (file-system
   (mount-point "/gnu")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/gnu"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-guix
  (file-system
   (mount-point "/var/guix")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/guix"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-home
  (file-system
   (mount-point "/home")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/home"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define nfs-valhalla
  (file-system
   (device "fafner:/srv/nfs4/Valhalla")
   (mount-point "/media/Valhalla")
   (type "nfs4")
   (mount? #f)
   (check? #f)))

(define menu-arch
  (menu-entry
   (label "Arch Linux")
   (linux "/__current/arch-root/boot/vmlinuz-linux")
   

Re: GNU Guix 1.0.0 released

2019-05-05 Thread Fredrik Salomonsson
Congrats all, for your hard work! And many thanks to creating such an
awesome system.

Den tors 2 maj 2019 kl 14:15 skrev Ludovic Courtès :

> We are thrilled to announce the release of GNU Guix 1.0.0!
>
> This 1.0 release is a major milestone for Guix.  It represents 7 years
> of hard work with more than 40,000 commits by 260 people, 19 releases,
> and an equally amazing amount of work on documentation, translation,
> artwork, web design, mentoring, outreach, and many other activities that
> together have made it a thriving project.
>
> Read more about today’s announcement at:
>
>   https://gnu.org/software/guix/blog/2019/gnu-guix-1.0.0-released
>
> Whether you’re a software developer, a user, or a free software
> enthusiast, we hope GNU Guix will provide you with the tools to deploy
> and manage software with confidence and ease, qualities that are not
> usually associated with software deployment.  We’d love to hear from you!
>
> • About
>
>   GNU Guix is a transactional package manager and an advanced
>   distribution of the GNU system that respects user freedom.  Guix can
>   be used on top of any system running the kernel Linux, or it can be
>   used as a standalone operating system distribution for i686, x86_64,
>   ARMv7, and AArch64 machines.
>
>   In addition to standard package management features, Guix supports
>   transactional upgrades and roll-backs, unprivileged package
>   management, per-user profiles, and garbage collection.  When used as a
>   standalone GNU/Linux distribution, Guix offers a declarative,
>   stateless approach to operating system configuration management.  Guix
>   is highly customizable and hackable through Guile programming
>   interfaces and extensions to the Scheme language.
>
>   https://www.gnu.org/software/guix/
>
> • Download
>
>   Here are the compressed sources and a GPG detached signature[*]:
> https://ftp.gnu.org/gnu/guix/guix-1.0.0.tar.gz
> https://ftp.gnu.org/gnu/guix/guix-1.0.0.tar.gz.sig
>
>   Here are the bootable USB installation images and their signatures[*]:
>
> https://ftp.gnu.org/gnu/guix/guix-system-install-1.0.0.i686-linux.iso.xz
>
> https://ftp.gnu.org/gnu/guix/guix-system-install-1.0.0.i686-linux.iso.xz.sig
>
> https://ftp.gnu.org/gnu/guix/guix-system-install-1.0.0.x86_64-linux.iso.xz
>
> https://ftp.gnu.org/gnu/guix/guix-system-install-1.0.0.x86_64-linux.iso.xz.sig
>
>   Here is the QCOW2 virtual machine (VM) image and its signature:
>
> https://ftp.gnu.org/gnu/guix/guix-system-vm-image-1.0.0.x86_64-linux.xz
>
> https://ftp.gnu.org/gnu/guix/guix-system-vm-image-1.0.0.x86_64-linux.xz.sig
>
>   Here are the binary tarballs and their signatures[*]:
> https://ftp.gnu.org/gnu/guix/guix-binary-1.0.0.i686-linux.tar.xz
> https://ftp.gnu.org/gnu/guix/guix-binary-1.0.0.i686-linux.tar.xz.sig
> https://ftp.gnu.org/gnu/guix/guix-binary-1.0.0.x86_64-linux.tar.xz
> https://ftp.gnu.org/gnu/guix/guix-binary-1.0.0.x86_64-linux.tar.xz.sig
> https://ftp.gnu.org/gnu/guix/guix-binary-1.0.0.armhf-linux.tar.xz
> https://ftp.gnu.org/gnu/guix/guix-binary-1.0.0.armhf-linux.tar.xz.sig
> https://ftp.gnu.org/gnu/guix/guix-binary-1.0.0.aarch64-linux.tar.xz
>
> https://ftp.gnu.org/gnu/guix/guix-binary-1.0.0.aarch64-linux.tar.xz.sig
>
>   Use a mirror for higher download bandwidth:
> https://www.gnu.org/order/ftp.html
>
>   Here are the SHA1 checksums:
>
>   fd64cd4347214a4e75d611696c9929cba8995323  guix-1.0.0.tar.gz
>   c17006616782405eee852dbd85292e73a0182d7e
> guix-binary-1.0.0.aarch64-linux.tar.xz
>   9b168fa2835f911b9f340f2930d28b1287b53004
> guix-binary-1.0.0.armhf-linux.tar.xz
>   a75a2571cc7aa8dbbb0a355bf1a29f4475c243ff
> guix-binary-1.0.0.i686-linux.tar.xz
>   6ebfcb5cbed6dcd0c7514b8b3f2406125d30f1a5
> guix-binary-1.0.0.x86_64-linux.tar.xz
>   c9f67b69b45a0ac4946e4472511e925782129e92
> guix-system-install-1.0.0.i686-linux.iso.xz
>   802177714b7c96cf83dcab4b24e36f3111ba64b8
> guix-system-install-1.0.0.x86_64-linux.iso.xz
>   244c3218326a706f495bfa2a7c03fe5f68549a8e
> guix-system-vm-image-1.0.0.x86_64-linux.xz
>
>   [*] Use a .sig file to verify that the corresponding file (without the
>   .sig suffix) is intact.  First, be sure to download both the .sig file
>   and the corresponding tarball.  Then, run a command like this:
>
> gpg --verify guix-1.0.0.tar.gz.sig
>
>   If that command fails because you don't have the required public key,
>   then run this command to import it:
>
> gpg --keyserver pool.sks-keyservers.net \
> --recv-keys 3CE464558A84FDC69DB40CFB090B11993D9AEBB5
>
>   and rerun the 'gpg --verify' command.
>
>   To install the standalone Guix system, please see “System
>   Installation” in the manual.  To install Guix on a running system, see
>   “Installation” in the manual.
>
> • Changes since version 0.16.0 (excerpt from the NEWS file)
>
>  ** Package management
>  *** New ‘-v’/‘--verbosity’ option for all commands
>  *** Most commands now default to verbosity level 1 (“quiet”)
>  *** New ‘guix 

Problem with polybar

2019-02-02 Thread Fredrik Salomonsson
Hello guix!

I'm having issues with polybar. When running it the bar isn't
rendered. It prints out everything just fine if I run it with
--stdout. I tried modifying the package definition to use cario-xcb
incase that was an issue. But same result.

Tested it in GuixSD and on a foreign distro but same issue. The native
built polybar on the foreign distro works.

Has anyone else come a cross this issue?

guix --version
24886c13892551f164aef20375939fc4e85942ab

Attached my config and the manifest I use.

Thanks 
-- 
s/Fred[re]+i[ck]+/Fredrik/g

;-*- mode: scheme; -*-
(specifications->manifest
 '(;; Fonts
   "font-hack"
   "font-dejavu"
   ;; Base
   "rxvt-unicode"
   "stow"
   "git"
   "openssh"
   "ncurses"
   "feh"
   "xrandr"
   "bash-completion"
   "glibc-utf8-locales"
   ;; Utils
   "the-silver-searcher"
   "password-store"
   "gnupg"
   ;; Programs
   "icecat"
   "graphviz"
   "polybar"
   ;; "ledger"
   ;; "darktable"
   ;; emacs
   "emacs"
   "emacs-pdf-tools"
   "emacs-emms"
   ;; build tools
   "make"
   "gcc"
   "binutils"
   "glibc"
   "strace"
   "gdb"
   "global"
   "guile"
   ;; qmk
   "avr-gcc"
   "avr-toolchain"
   "avr-binutils"
   "avrdude"
   "teensy-loader-cli"
   ))
;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu)
 (gnu packages)
 (gnu system nss)
 (gnu system locale)
 (gnu services nfs)
 (ice-9 rdelim)
 (ice-9 format))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs shells xdisorg)

(define plattfot
  (user-account
   (name "plattfot")
   (group "users")
   ;; Define a G-Expr to find the path of the zsh binary:
   ;; 
https://gitlab.com/rain1/guix-wiki/wikis/FAQ#how-do-i-make-my-login-shell-zsh
   ;;(shell #~(string-append #$zsh "/bin/zsh"))
   (supplementary-groups '("wheel" "netdev" "audio" "video"))
   (home-directory "/home/plattfot")))

(define keyboard-conf "
Section \"InputClass\"
Identifier \"system-keyboard\"
MatchIsKeyboard \"on\"
Option \"XkbLayout\" \"us,se\"
Option \"XkbOptions\" \"ctrl:nocaps,grp:sclk_toggle,grp_led:scroll,:2\"
EndSection
")

;; Specify a mapped device for the encrypted root partition.
;; The UUID is that returned by 'cryptsetup luksUUID'.
(define mapped-root
  (mapped-device
   (source (uuid "ab43f8be-1a18-4999-836d-71dac382dfb5"))
   (target "root")
   (type luks-device-mapping)))

(define mapped-swap
  (mapped-device
   (source (uuid "9f04f917-efd3-4036-b3f5-24705fee7ffa"))
   (target "swap")
   (type luks-device-mapping)))

;; Partion layout for /dev/sda3
;; under __current/
;; | subvol  | Mountpoint   | Comment| Shared   |
;; |-+--++--|
;; | arch-root   | /| root for Arch  | no   |
;; | guixsd-root | /| root for GuixSD| no   |
;; | grub| /boot/grub   | grub config| yes  |
;; | guix| /var/guix| guix stuff | yes  |
;; | gnu | /gnu | Store etc  | yes  |
;; | home| /home| home partition | yes  |

(define btrfs-common-options
  '("defaults" "discard" "compress=lzo" "space_cache" "autodefrag"))

(define (btrfs-mount-options subvol)
  "Return the btrfs mount options I use.
   Where SUBVOL is the subvolume to mount"
  (string-join `(,@btrfs-common-options ,(format #f "subvol=~a" subvol)) ","))

(define fs-root
  (file-system
   (mount-point "/")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/guixsd-root"))
   (needed-for-boot? #t)
   (dependencies `(,mapped-root

(define fs-grub
  (file-system
   (mount-point "/boot/grub")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/grub"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-gnu
  (file-system
   (mount-point "/gnu")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/gnu"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-guix
  (file-system
   (mount-point "/var/guix")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/guix"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-home
  (file-system
   (mount-point "/home")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/home"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define nfs-valhalla
  (file-system
   (device "fafner:/srv/nfs4/Valhalla")
   (mount-point "/media/Valhalla")
   (type "nfs4")
   (mount? #f)
   (check? #f)))

(define menu-arch
  (menu-entry
   (label "Arch Linux")
   (linux "/__current/arch-root/boot/vmlinuz-linux")
   (linux-arguments

Help to workaround #28144

2019-01-28 Thread Fredrik Salomonsson
Hello guix,

I'm hitting the issue described in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28144

This happens when I do "guix pull", "guix package -u" or "guix
environment guix".

guix --version
guix (GNU Guix) 0.16.0-8.7ba2b27

The comments mention deleting "guix/profiles.go" should work as a work
around. But I'm not sure which one that is. Is there a more detail
explination somewhere that I can follow?

Thanks.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: error: rmdir: Device or resource busy

2018-12-08 Thread Fredrik Salomonsson


Hej

swedebu...@riseup.net writes:

> Hej!
>
> On 2018-12-08 09:05, Fredrik Salomonsson wrote:
>> Hello,
>> 
>> tried installing GuixSD 0.16. But hitting a cryptic error.
>> 
>> guix system init /mnt/etc/config.scm /mnt
>> --substitute-urls="http://berlin.guixsd.org http://mirror.hydra.gnu.org;
>> ...
>> /gnu/store/sh9x3mhl5q60yxhl861kpk6vm70l3w81-bootloader-installer
>> 
>> initializing operating system under '/mnt'...
>> guix system: error: rmdir: Device or resource busy
>> 
>> This was working fine with 0.15.
>> 
>> Is there a way to get a better backtrace from system init? 
>
> Yes!
>
> From the manual: 
> '--on-error=STRATEGY'
>  Apply STRATEGY when an error occurs when reading FILE.  STRATEGY
>  may be one of the following:
>
>  'nothing-special'
>   Report the error concisely and exit.  This is the default
>   strategy.
>
>  'backtrace'
>   Likewise, but also display a backtrace.
>
>  'debug'
>   Report the error and enter Guile's debugger.  From there, you
>   can run commands such as ',bt' to get a backtrace, ',locals'
>   to display local variable values, and more generally inspect
>   the state of the program.  *Note (guile)Debug Commands::, for
>   a list of available debugging commands.
>
> Actually the --help to "guix system" hints about this but it is not
> telling how to use it, which is a bug I think. (i'm going to report it
> and send a patch)

Tackar! Completely missed that option when I checked --help. But it
looks like that option doesn't do anything for me. Still got the same
error message.

>> Or does anyone
>> know what the error might be?
>
> I never saw it before.

Me neither. I ended up just installing guix-0.15 instead.  Did a guix
pull to --branch=version-0.16.0 (I hope that is equivalent). And
currently waiting for it to finish reconfigure.

Got carried away with just playing around with the system, after I
installed 0.15. Really nice system I must say. Only crucial package I'm
missing is polybar. At the moment, having a hard time keeping track of my
windows in i3 :). But I figured that will be a good introduction in packaging
stuff for guix.

Anyway, thanks for the help again!

-- 
s/Fred[re]+i[ck]+/Fredrik/g



error: rmdir: Device or resource busy

2018-12-08 Thread Fredrik Salomonsson

Hello,

tried installing GuixSD 0.16. But hitting a cryptic error.

guix system init /mnt/etc/config.scm /mnt
--substitute-urls="http://berlin.guixsd.org http://mirror.hydra.gnu.org;
...
/gnu/store/sh9x3mhl5q60yxhl861kpk6vm70l3w81-bootloader-installer

initializing operating system under '/mnt'...
guix system: error: rmdir: Device or resource busy

This was working fine with 0.15.

Is there a way to get a better backtrace from system init? Or does anyone
know what the error might be?

Thanks

;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu)
 (gnu packages)
 (gnu system nss)
 (gnu system locale)
 (gnu services nfs)
 (ice-9 rdelim)
 (ice-9 format))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs shells xdisorg)

(define plattfot
  (user-account
   (name "plattfot")
   (group "users")
   ;; Define a G-Expr to find the path of the zsh binary:
   ;; 
https://gitlab.com/rain1/guix-wiki/wikis/FAQ#how-do-i-make-my-login-shell-zsh
   (shell #~(string-append #$zsh "/bin/zsh"))
   (supplementary-groups '("wheel" "netdev" "audio" "video"))
   (home-directory "/home/plattfot")))

;; (define keyboard-conf
;;   (call-with-input-file "/etc/config.d/00-keyboard.conf" read-string))

;; Specify a mapped device for the encrypted root partition.
;; The UUID is that returned by 'cryptsetup luksUUID'.
(define mapped-root
  (mapped-device
   (source (uuid "ab43f8be-1a18-4999-836d-71dac382dfb5"))
   (target "root")
   (type luks-device-mapping)))

(define mapped-swap
  (mapped-device
   (source (uuid "9f04f917-efd3-4036-b3f5-24705fee7ffa"))
   (target "swap")
   (type luks-device-mapping)))

;; Partion layout for /dev/sda3
;; under __current/
;; | subvol  | Mountpoint   | Comment| Shared   |
;; |-+--++--|
;; | arch-root   | /| root for Arch  | no   |
;; | guixsd-root | /| root for GuixSD| no   |
;; | grub| /boot/grub   | grub config| yes  |
;; | guix| /var/guix| guix stuff | yes  |
;; | gnu | /gnu | Store etc  | yes  |
;; | home| /home| home partition | yes  |

(define btrfs-common-options
  '("defaults" "discard" "compress=lzo" "space_cache" "autodefrag"))

(define (btrfs-mount-options subvol)
  "Return the btrfs mount options I use.
   Where SUBVOL is the subvolume to mount"
  (string-join `(,@btrfs-common-options ,(format #f "subvol=~a" subvol)) ","))

(define fs-root
  (file-system
   (mount-point "/")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/guixsd-root"))
   (needed-for-boot? #t)
   (dependencies `(,mapped-root

(define fs-grub
  (file-system
   (mount-point "/boot/grub")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/grub"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-gnu
  (file-system
   (mount-point "/gnu")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/gnu"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-guix
  (file-system
   (mount-point "/var/guix")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/guix"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-home
  (file-system
   (mount-point "/home")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/home"))
   (needed-for-boot? #t)
   (dependencies `(,fs-root

(define fs-valhalla
  (file-system
   (device "fafner:/srv/nfs4/Valhalla")
   (mount-point "/media/Valhalla")
   (type "nfs4")
   (mount? #f)
   (check? #f)))

(define menu-arch
  (menu-entry
   (label "Arch Linux")
   (linux "/boot/vmlinux")
   (linux-arguments
'("luks.uuid=ab43f8be-1a18-4999-836d-71dac382dfb5"
  "luks.name=ab43f8be-1a18-4999-836d-71dac382dfb5=root"
  "luks.key=ab43f8be-1a18-4999-836d-71dac382dfb5=/boot/rootkey.bin"
  "luks.options=ab43f8be-1a18-4999-836d-71dac382dfb5=discard,luks"
  "luks.uuid=9f04f917-efd3-4036-b3f5-24705fee7ffa"
  "luks.name=9f04f917-efd3-4036-b3f5-24705fee7ffa=swap"
  "luks.key=9f04f917-efd3-4036-b3f5-24705fee7ffa=/boot/swapkey.bin"
  "luks.options=9f04f917-efd3-4036-b3f5-24705fee7ffa=swap,discard,luks"
  "root=LABEL=root"
  "resume=/dev/mapper/swap"
  "rootflags=compress=lzo,subvol=__current/arch-root"))
   (initrd "/boot/initramfs-linux.img")))

(operating-system
 (host-name "loke")
 (timezone "Canada/Pacific")
 (locale "en_US.utf8")
 (locale-definitions
  (list
   (locale-definition (name "en_US.utf8") (source "en_US") (charset "UTF-8"))
   (locale-definition (name "sv_SE.utf8") 

Re: btrfs and subvolumes for root, take 2

2018-12-02 Thread Fredrik Salomonsson


Hi,

Ludovic Courtès  writes:

> Fredrik Salomonsson  skribis:
>
>> Ludovic Courtès  writes:
>>
>>> The Guile backtrace you sent shows that /etc/ssl already existed when
>>> your system booted and was not a symlink.  This led the “activation
>>> code” of GuixSD to fail:
>>>
>>>   
>>> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/activation.scm#n320
>>>
>>> The solution is to remove /etc/ssl (is it coming from another distro
>>> previously installed on this device?).  You can boot a separate medium, 
>>> mount the root partition, and “rm -rf /etc/ssl” from there.  Or you can,
>>> at the boot REPL that you get after the backtrace, type something like:
>>>
>>>   ,use (guix build utils)
>>>   (delete-file-recursively "/etc/ssl")
>>>   ,q
>>>
>>> Note that you might have similar issues with /etc/pam.d, for instance,
>>> if there’s such a stale directory.
>>
>> Thanks for the reply. That pointed me in the right direction. Although
>> the solution you suggested wasn't an option for me. As it turned out, it
>> was actually mounting my Arch Linux root (__current/arch-root). Which I
>> had set to be the default subvolume if no ~subvol=~ option is given when
>> mounting the disk.
>
> Clearly / or /etc cannot be shared between GuixSD and another distro;
> each distro needs to have full control over these.  My suggestion would
> be to share nothing but /home (and /gnu, /var/guix, and /etc/guix if you
> want to able to use Guix on the other distro).
>
> I can’t really advise more than this since the specifics are then a
> matter of taste.  :-)

I think you misunderstood what I meant. I'm not sharing / or /etc
between GuixSD and Arch linux. Both have their own / (and /etc), in
their own subvolume (think partitions for ext4).

See this thread for a full explanation of my disk layout:
https://lists.gnu.org/archive/html/help-guix/2017-08/msg00011.html

But in short, only /home, /gnu, /var/guix and /boot/grub are shared
between the two. The issue I had was that for some reason when booting
GuixSD. It ignore the rootflags for mounting GuixSD's /, instead it
mounted the / for Arch, as that was the default. Which causes the
error. Clearly I do not want it to share /etc between the two, that
would be madness. :)

I worked around that by changing the default to GuixSD's /. So now it's
mounting the correct subvolumes. Sorry about the confusion.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



Re: btrfs and subvolumes for root, take 2

2018-12-01 Thread Fredrik Salomonsson

Hi Ludo,

Ludovic Courtès  writes:

> The Guile backtrace you sent shows that /etc/ssl already existed when
> your system booted and was not a symlink.  This led the “activation
> code” of GuixSD to fail:
>
>   
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/activation.scm#n320
>
> The solution is to remove /etc/ssl (is it coming from another distro
> previously installed on this device?).  You can boot a separate medium, 
> mount the root partition, and “rm -rf /etc/ssl” from there.  Or you can,
> at the boot REPL that you get after the backtrace, type something like:
>
>   ,use (guix build utils)
>   (delete-file-recursively "/etc/ssl")
>   ,q
>
> Note that you might have similar issues with /etc/pam.d, for instance,
> if there’s such a stale directory.

Thanks for the reply. That pointed me in the right direction. Although
the solution you suggested wasn't an option for me. As it turned out, it
was actually mounting my Arch Linux root (__current/arch-root). Which I
had set to be the default subvolume if no ~subvol=~ option is given when
mounting the disk.

Since my goal is to be able to dual boot, I don't want to nuke my arch
subvolume.

But that gave me an idea. What if I just change the default subvolume to
my GuixSD root (__current/guixsd-root). I did that and what do you know
it booted!

The question is though why did it mount my default subvolume? I
specified it to mount __current/guixsd-root for the root filesystem. As
well as setting that to be the subvolume to mount in the rootflags for
the kernel command line when booting. Is there a third step that I'm
missing?

In either case thank you so much for your help. Been trying to get this
going for over a year now. So it feels good to finally see the login
screen!

I attached my install log, which has all the steps I needed to do in
order to install GuixSD on a btrfs disk. In case someone is interested.

-- 
s/Fred[re]+i[ck]+/Fredrik/g
#+author: Fredrik Salomonsson

* Install guix-0.15
** Setup network and ssh locally
   These things need to be first run locally on the machine you're
   installing GuixSD.
 Setup wireless and get ip

 #+BEGIN_SRC sh
   wpa_supplicant -i INTERFACE -B -c <(wpa_passphrase SSID PASSPHRASE)
   dhclient -v interface
 #+END_SRC

 Setup ssh
 Change the password to be able to connect to ssh
 #+BEGIN_SRC sh
   passwd
 #+END_SRC

 Then start the ssh service using shepherd
 #+BEGIN_SRC sh
   herd start ssh-daemon
 #+END_SRC

** Install Process

   NOTE: Change ~192.168.4.112~ to the ip you got from calling
   ~dhclient~ earlier.

 Fix known_hosts
 Note: If this is the first time, you can skip this step.

 Remove guix from known_hosts, as its key changes every reboot.
 #+BEGIN_SRC bash :dir ~/
   sed -iE 's/^192.168.4.112 .*//' .ssh/known_hosts
 #+END_SRC

 Mount disks

 This assumes that you have already setup an encrypted disk and
 setup the following layout for ~/dev/sda3~.

 Partion layout for /dev/sda3 under __current/
 | subvol  | Mountpoint   | Comment| Shared   |
 |-+--++--|
 | arch-root   | /| root for Arch  | no   |
 | guixsd-root | /| root for GuixSD| no   |
 | grub| /boot/grub   | grub config| yes  |
 | guix| /var/guix| guix stuff | yes  |
 | gnu | /gnu | Store etc  | yes  |
 | home| /home| home partition | yes  |

 Decrypt the disk
 #+BEGIN_SRC sh :dir /ssh:root@192.168.4.112: :session
   cryptsetup open --type luks /dev/sda2 swap && cryptsetup open --type 
luks /dev/sda3 root
 #+END_SRC

 Mount the different subvolumes
 #+BEGIN_SRC sh :dir /ssh:root@192.168.4.112: :session
   mount -o 
defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/guixsd-root
 LABEL=root /mnt/
   mount -o 
defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/grub 
LABEL=root /mnt/boot/grub/
   mount -o 
defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/guix 
LABEL=root /mnt/var/guix
   mount -o 
defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/gnu 
LABEL=root /mnt/gnu
 #+END_SRC

 Enable swap
 #+BEGIN_SRC bash :dir /ssh:root@192.168.4.112: :session
   mkswap /dev/mapper/swap
   swapon /dev/mapper/swap
 #+END_SRC
 Config
 Copy the config files

 The guixsd configuration
 #+BEGIN_SRC scheme :session :tangle 
/ssh:root@192.168.4.112:/mnt/etc/config.scm :mkdirp yes
   ;; This is an operating system configuration template
   ;; for a "desktop" setup without full-blown desktop
   ;; environments.

   (use-modules (gnu)
(gnu 

Re: sha256 hash mismatch

2018-11-21 Thread Fredrik Salomonsson
> swedebugia  writes:

> Installing a simpler config.scm and going incrementally forward with
> small changes might be worth considering.

Yeah, I refactored my config.scm to clean up all the mount flags I need
for btrfs. As well as to make sure the root is mounted before the other
mounts (gnu/store, grub etc). So I might have screwed up
something. Although I have never got GuixSD to work with this config so
could be something completely different.

Is there a quick way to just load the config.scm into the guile REPL
when booted into the iso and inspect the operating-system record? To
make sure everything looks good before running the whole install
process.

As the whole task of setup wifi -> setup ssh -> guix system init ->
reboot turn around is quite long. I guess I could just write script and
put that on the iso to speed it up.

> Especially given that our guix/guile error messages can sometimes be
> quite cryptic if you dont know exactly what change caused the error.

Indeed, I had to look into the source code for why it was complaining
about my home file-system couldn't list the root file-system as a
dependency. Turns out it was because root has `needed-for-boot?' set to
true where as home didn't.

Den ons 21 nov. 2018 kl 08:00 skrev swedebugia :

> On 2018-11-21 08:33, Fredrik Salomonsson wrote:
> > swedebugia  writes:
> snip
>
> >
> > Put berlin first in the --substitute-urls and did a guix pull to one
> > commit that had the most packages built. Using
> > http://berlin.guixsd.org/jobset/guix-master to pick out the commit.
> >
> > The install took less than 20min on my x220. Thanks for all the help!
>
>
> :D Great that you got past the init state.
>
> >
> > Though I needed to manually hack the grub.cfg to be able to
> > boot. Otherwise it wouldn't find the kernel.
> >
> > Now it get stuck when trying to mount the filesystem. Backtrace shows
> > it's failing in ./gnu/build/file-system.scm 613:6
> >
> > Might have something misconfigured in my config file. Anyways that's not
> > what this thread is about. If I cannot figure it out I'll send another
> > email.
> >
> > Thanks again for the help!
> >
>
> Installing a simpler config.scm and going incrementally forward with
> small changes might be worth considering.
>
> Especially given that our guix/guile error messages can sometimes be
> quite cryptic if you dont know exactly what change caused the error.
>
> --
> Cheers Swedebugia
>


-- 
s/Fred[re]+i[ck]+/Fredrik/g


Re: sha256 hash mismatch

2018-11-20 Thread Fredrik Salomonsson
swedebugia  writes:

> I asume yes, but unfortunately hydra is not our most reliable 
> infrastructure and we are in a process to replace it with berlin.
>
> After authorizing both: run init with 
> --substitute-urls="http://berlin.guixsd.org http://mirror.hydra.gnu.org;
>
> Then your should see that guix looks for substitutes from both.
>

>
> Check here e.g. http://berlin.guixsd.org/jobset/guix-master
>
> Berlin is the fastest and is quite reliable. Hydra is a backup in my 
> configuration but not needed if berlin is online.
>

Put berlin first in the --substitute-urls and did a guix pull to one
commit that had the most packages built. Using
http://berlin.guixsd.org/jobset/guix-master to pick out the commit.

The install took less than 20min on my x220. Thanks for all the help!

Though I needed to manually hack the grub.cfg to be able to
boot. Otherwise it wouldn't find the kernel.

Now it get stuck when trying to mount the filesystem. Backtrace shows
it's failing in ./gnu/build/file-system.scm 613:6

Might have something misconfigured in my config file. Anyways that's not
what this thread is about. If I cannot figure it out I'll send another
email.

Thanks again for the help!

-- 
s/Fred[re]+i[ck]+/Fredrik/g


grub.cfg.guixsd
Description: Binary data


Re: sha256 hash mismatch

2018-11-19 Thread Fredrik Salomonsson
Den mån 19 nov. 2018 10:53 skrev swedebugia :

Welcome to guix :)

Thanks!

Sorry about the rough start. Guix-land is a real adventure sometimes!


No worries. Not my first time venturing into guix-land. I'm a little bit
more prepared this time. Got a wifi-card that linux-libre supports. And I'm
more familiar with the guile language.

Thanks for specifying the command and config.scm.
Did you follow the manual?

Yes. I only authorised berlin. As I assume hydra is already authorised. Is
that assumption correct?

I suspect you did not as guix was trying to build stuff (normally we
have substitutes for almost everything if you either run init without
pulling first (=guix 0.15) or pull to a commit a week ago or so.

Getting substitutes to work is crucial if you are not very patient. The
hash mismatches are a plague brought by changes upstream which are NOT
retroactively fixed.

You can check the availability of substitutes with "guix weather".

With substitutes working and available init should not take more that 10
min on a recent machine. It would probably be a good idea to state this
in the manual.


Thanks for pointing out "guix weather". I've seen it mentioned from time to
time in the mailing list. But didn't know what it was used for. Any good
workflow to find a commit that have good substitute coverage? As from what
I understand, reading the manual. It will only check the guix version
you're running.

If you want to hack on guix you will have to update guix above 0.15.


That's my end goal. Just need to be able to install it. :)

Will try to do a guix pull, to see if that works.

Den mån 19 nov. 2018 10:53 skrev swedebugia :

> Welcome to guix :)
>
> On 2018-11-19 06:10, Fredrik Salomonsson wrote:
> > Hi,
> >
> > Trying to install guix-0.15 to see if I can get dual booting with btrfs
> > working on my laptop. But didn't get that far. Encounter an error when
> > running guix system init. Ran it twice, same error. Any idea what could
> > be wrong? Took about 4-6h to run it the first time.
>
> Sorry about the rough start. Guix-land is a real adventure sometimes!
>
> >
> > Here's the command:
> > guix system init /mnt/etc/config.scm /mnt/
> > --substitute-urls="https://hydra.gnu.org https://berlin.guixsd.org;
> Thanks for specifying the command and config.scm.
> Did you follow the manual? (e.g. authorize the keys for both servers
> above?)
>
> I suspect you did not as guix was trying to build stuff (normally we
> have substitutes for almost everything if you either run init without
> pulling first (=guix 0.15) or pull to a commit a week ago or so.
>
> Getting substitutes to work is crucial if you are not very patient. The
> hash mismatches are a plague brought by changes upstream which are NOT
> retroactively fixed.
>
> You can check the availability of substitutes with "guix weather".
>
> With substitutes working and available init should not take more that 10
> min on a recent machine. It would probably be a good idea to state this
> in the manual.
>
> If you want to hack on guix you will have to update guix above 0.15.
>
> --
> Cheers
> Swedebugia
>


sha256 hash mismatch

2018-11-18 Thread Fredrik Salomonsson
Hi,

Trying to install guix-0.15 to see if I can get dual booting with btrfs
working on my laptop. But didn't get that far. Encounter an error when
running guix system init. Ran it twice, same error. Any idea what could be
wrong? Took about 4-6h to run it the first time.

Here's the command:
guix system init /mnt/etc/config.scm /mnt/ --substitute-urls="
https://hydra.gnu.org https://berlin.guixsd.org;
And here's the output of the second run, minus a bunch of substitute:
updating...

Starting download of
/gnu/store/j8cahmsfnjpdw49aa1qybrs0sm5z86fm-openal-soft-1.18.2.tar.bz2
>From http://kcat.strangesoft.net/openal-releases/openal-soft-1.18.2.tar.bz2.
..
 18.2.tar.bz2 2.1MiB/s 00:00 | 10KiB
transferred
sha256 hash mismatch for output path
`/gnu/store/j8cahmsfnjpdw49aa1qybrs0sm5z86fm-openal-soft-1.18.2.tar.bz2'
  expected: 10kydm8701a2kppiss9sdidn1820cmzhqgx1b2bsa5dsgzic32lz
  actual:   0m22iiwrg5lf4xjhapk9i801kc2mi7bgyxnl38qblhgp3nz2qlj5
cannot build derivation
`/gnu/store/860d96xqghxc01nx8x4v6xyz367lq7jd-openal-1.18.2.drv': 1
dependencies couldn't be built
cannot build derivation
`/gnu/store/9z2n3s1dhlz0xd2pajcjaqygysa50jx0-ffmpeg-4.0.1.drv': 1
dependencies couldn't be built
cannot build derivation
`/gnu/store/zgv9i7irmmph9qck7pf3vsy3y9qd835q-alsa-plugins-1.1.6.drv': 1
dependencies couldn't be built
guix system: error: build failed: build of
`/gnu/store/zgv9i7irmmph9qck7pf3vsy3y9qd835q-alsa-plugins-1.1.6.drv' failed

I attached my config files, 00-keyboard.conf is placed in /etc/config.d

Thanks
-- 
s/Fred[re]+i[ck]+/Fredrik/g
# Map Ctrl to caps, toggle between us and swedish keyboard layout. Scroll lock 
led is on when using swedish layout.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us,se"
Option "XkbOptions" "ctrl:nocaps,grp:sclk_toggle,grp_led:scroll,:2"
EndSection
;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu)
	 (gnu packages)
	 (gnu system nss)
	 (gnu system locale)
	 (gnu services nfs)
	 (ice-9 rdelim)
 (ice-9 format))
(use-service-modules desktop networking ssh base xorg)
(use-package-modules wm certs shells xdisorg)

(define plattfot 
  (user-account
   (name "plattfot")
   (group "users")
   ;; Define a G-Expr to find the path of the zsh binary:
   ;; https://gitlab.com/rain1/guix-wiki/wikis/FAQ#how-do-i-make-my-login-shell-zsh
   (shell #~(string-append #$zsh "/bin/zsh"))
   (supplementary-groups '("wheel" "netdev" "audio" "video"))
   (home-directory "/home/plattfot")))

;;(define keyboard-conf
  ;;(call-with-input-file "/etc/config.d/00-keyboard.conf" read-string))

;; Specify a mapped device for the encrypted root partition.
;; The UUID is that returned by 'cryptsetup luksUUID'.
(define mapped-root
  (mapped-device
   (source (uuid "ab43f8be-1a18-4999-836d-71dac382dfb5"))
   (target "root")
   (type luks-device-mapping)))

(define mapped-swap
  (mapped-device
   (source (uuid "9f04f917-efd3-4036-b3f5-24705fee7ffa"))
   (target "swap")
   (type luks-device-mapping)))

;; Partion layout for /dev/sda3
;; under __current/
;; | subvol  | Mountpoint   | Comment| Shared   |
;; |-+--++--|
;; | arch-root   | /| root for Arch  | no   |
;; | guixsd-root | /| root for GuixSD| no   |
;; | grub| /boot/grub   | grub config| yes  |
;; | guix| /var/guix| guix stuff | yes  |
;; | gnu | /gnu | Store etc  | yes  |
;; | home| /home| home partition | yes  |

(define btrfs-common-options
  '("defaults" "discard" "compress=lzo" "space_cache" "autodefrag"))

(define (btrfs-mount-options subvol)
  "Return the btrfs mount options I use.
Where SUBVOL is the subvolume to mount"
  (string-join (cons (format #f "subvol=~a" subvol) btrfs-common-options) ","))

(define fs-root
  (file-system
   (mount-point "/")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/guixsd-root"))
   (needed-for-boot? #t)
   (dependencies (list mapped-root

(define fs-grub
  (file-system
   (mount-point "/boot/grub")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/grub"))
   (needed-for-boot? #t)
   (dependencies (list fs-root

(define fs-gnu
  (file-system
   (mount-point "/gnu")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "__current/gnu"))
   (needed-for-boot? #t)
   (dependencies (list fs-root

(define fs-guix
  (file-system
   (mount-point "/var/guix")
   (type "btrfs")
   (device (file-system-label "root"))
   (options (btrfs-mount-options "subvol=__current/guix"))
   (needed-for-boot? #t)
   (dependencies (list fs-root

(define fs-home
  

Re: "guix offload test" gets stuck with no output.

2018-06-28 Thread Fredrik Salomonsson
Hallå

No. Not yet at least. See http://lists.gnu.org/archive/
> html/guix-devel/2018-06/msg00316.html where I also proposed a change to
> guix pull which makes it do the least cpu intensive update by default.
>

Interesting. So how do you find a commit that have the least cpu intensive
update?

2018-06-28 11:45 GMT-07:00 swedebugia :

> Hej 
>
> On June 28, 2018 6:36:57 PM GMT+02:00, Fredrik Salomonsson <
> platt...@gmail.com> wrote:
> >Hi
> >
> >1) the new possibility of picking a commit that hydra already built
> >thus
> >> avoiding the compilation of guix locally?
> >
> >Didn't know that. Is that some sort of combination with "guix weather"
> >and
> >"guix pull --commit"?
>
> No. Not yet at least. See http://lists.gnu.org/archive/
> html/guix-devel/2018-06/msg00316.html where I also proposed a change to
> guix pull which makes it do the least cpu intensive update by default.
>
> --
> Cheers Swedebugia
>



-- 
s/Fred[re]+i[ck]+/Fredrik/g


Re: "guix offload test" gets stuck with no output.

2018-06-28 Thread Fredrik Salomonsson
Hi

1) the new possibility of picking a commit that hydra already built thus
> avoiding the compilation of guix locally?

Didn't know that. Is that some sort of combination with "guix weather" and
"guix pull --commit"?


>  2) the ability to control the cpu frequency via a governor or the program
> cpufreq-set?

That I'm aware of, but newer hit me to throttle the cpu though when
building. Thanks for the tip!

Given that I'm still curious to get the offload working as I have an
desktop machine just sitting and collecting dust and would be fun to put
that to use.


2018-06-28 0:02 GMT-07:00 swedebugia :

>
>
> On June 28, 2018 8:09:14 AM GMT+02:00, Fredrik Salomonsson <
> platt...@gmail.com> wrote:
> >Hi,
> >
> >got inspired by this thread to try and setup offloading for my laptop.
> >As
> >everytime I run guix pull my laptop sounds like it's preparing to take
> >off.
> >
>
> Hi.
> Are you aware of
> 1) the new possibility of picking a commit that hydra already built thus
> avoiding the compilation of guix locally?
> 2) the ability to control the cpu frequency via a governor or the program
> cpufreq-set?
>
> This helps me keep my laptop temperature in check and guix pull with
> picked commit only takes a few minutes to complete.
> --
> Cheers Swedebugia
>



-- 
s/Fred[re]+i[ck]+/Fredrik/g


Re: "guix offload test" gets stuck with no output.

2018-06-28 Thread Fredrik Salomonsson
Hi,

got inspired by this thread to try and setup offloading for my laptop. As
everytime I run guix pull my laptop sounds like it's preparing to take off.

But running into problems similar to what Matthew described. I.e. it just
get stuck.

> $ guix offload test
>
guix offload: testing 1 build machines defined in
> '/etc/guix/machines.scm'...
>
guix offload: '192.168.1.105' is running guile (GNU Guile) 2.2.3
>

 On the build machine however I see

> Jun 27 22:26:05 localhost sshd[3203]: error: connect_to localhost port
> 37146: failed.
> Jun 27 22:26:05 localhost sshd[3203]: error: connect_to localhost port
> 37146: failed.
> Jun 27 22:42:11 localhost sshd[4136]: error: connect_to localhost port
> 37146: failed.
> Jun 27 22:42:11 localhost sshd[4136]: error: connect_to localhost port
> 37146: failed.
>

My laptop is using guix on a foreign distro (arch) with the guix version
"4bfd8579f9e06a0a0eafb69be7233bb99c75a02e".
The build machine is a GuixSD VM on my desktop with the same guix version.
Checked the message, shepherd.log and secure logs but couldn't find
anything that looked wrong.

My machine.scm looks like:

> (list (build-machine
>(name "192.168.1.105")
>(system "x86_64-linux")
>(user "plattfot")
>(host-key "ssh-ed25519  root@(none)")
>(private-key "/home/plattfot/.ssh/id_guix")
>))
>

$HOME/.config/guix/current/bin is in the PATH on both machines.

Anyone has any ideas what could be wrong? Or how to debug this?

Thanks


2018-06-16 16:49 GMT-07:00 Matthew Brooks :

> It seems to be working now, for some reason.
>
> I updated guix in the user and root accounts on the build machine again,
> and double-checked the .bashrc configs since one of them said I needed to
> add ".config/guix/current/bin" to the path (even though I swear I did that
> the other day, but it wasn't there today so maybe I didn't), and it's
> working now.
>
> If it breaks again, I'll let you all know, but
>



-- 
s/Fred[re]+i[ck]+/Fredrik/g


Re: build failed: unexpected EOF reading a line

2017-09-12 Thread Fredrik Salomonsson
>
> (You forgot to Cc the list.)

Thanks Ludovic.

Perhaps you should report the issue in AUR so that they can add these
> lines to the .service file by default.


Wrote a comment about it on the AUR. See if it gets added.

Anyway thanks again for your help.

2017-09-12 0:48 GMT-07:00 Ludovic Courtès <l...@gnu.org>:

> Hi Fredrik,
>
> (You forgot to Cc the list.)
>
> Fredrik Salomonsson <platt...@gmail.com> skribis:
>
> >  How did you set up guix-daemon?
> >
> >  Behind the scenes, guix-daemon invokes the internal ‘guix offload’
> >  command. That command requires Guile-SSH¹. In your case, it looks like
> >  Guile-SSH was found at configure-time when building Guix, but is now
> >  missing at run time, hence this “offload: command not found” error.
> >
> >  Could you make sure the GUILE_LOAD_PATH environment variable seen by
> >  guix-daemon points to Guile-SSH?
> >
> > I set it up as described here https://wiki.archlinux.org/index.php/Guix
> i.e. installed the AUR package, created the build users and launched the
> systemd unit guix-daemon.service.
> >
> > Turns out that the systemd unit doesn't setup the path to the
> GUILE_LOAD_PATH.
> >
> > Ran "systemctl edit guix-daemon" and added
> >
> > [Service]
> > Environment=GUILE_LOAD_PATH=/root/.guix-profile/share/guile/site/2.2
> > Environment=GUILE_LOAD_COMPILED_PATH=/root/.guix-profile/lib/guile/2.2
> >
> > then
> > systemctl daemon-reload
> > systemctl restart guix-daemon
> >
> > Not sure if the last steps are needed, but you can never be too careful
> when it comes to systemd.
> >
> > Anway that fixed it and I can now compile GNU hello.
>
> Awesome.
>
> Perhaps you should report the issue in AUR so that they can add these
> lines to the .service file by default.
>
> Thanks for your feedback,
> Ludo’.
>



-- 
s/Fred[re]+i[ck]+/Fredrik/g


build failed: unexpected EOF reading a line

2017-09-10 Thread Fredrik Salomonsson
Hi all,

I'm having issues using guix build. I'm suspecting some misconfiguration on
my end.

Since there are some stuff missing in guix that I use (i3blocks for
example) I thought I could try and create package definitions from them. I
haven't got my GuixSD working yet so I'm using guix running on Arch Linux.

I thought that it might be something wrong with my recipe I was writing. So
I tested to build the GNU Hello package from the manual (Defining Packages
).
I copied it into a file called gnu/packages/hello.scm
After that I ran "guix build -L$(pwd) hello".
But I'm getting these errors:

> guix: offload: command not found
> Try `guix --help' for more information.
> guix build: error: build failed: unexpected EOF reading a line
>

Not sure why it complains about missing offload command. I haven't setup it
up but when running "guix offload test" it prints out:

> guix offload: testing 0 build machines defined in
> '/etc/guix/machines.scm'...
>

But that's not what's blocking my, instead it's the EOF error.
My first thought was that I must have missed a newline after the
(define-public hello ...). Turns out that wasn't the case. Any idea what I
have missed? I'm still a complete noob when it comes to guile so I'm not
sure how to debug/trace the error.

I've attached the hello.scm

Thanks.

-- 
s/Fred[re]+i[ck]+/Fredrik/g
(define-module (gnu packages hello)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix licenses)
  #:use-module (gnu packages gawk))

(define-public hello
  (package
(name "hello")
(version "2.10")
(source (origin
  (method url-fetch)
  (uri (string-append "mirror://gnu/hello/hello-" version
  ".tar.gz"))
  (sha256
   (base32
"0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"
(build-system gnu-build-system)
(arguments '(#:configure-flags '("--enable-silent-rules")))
(inputs `(("gawk" ,gawk)))
(synopsis "Hello, GNU world: An example GNU package")
(description "Guess what GNU Hello prints!")
(home-page "http://www.gnu.org/software/hello/;)
(license gpl3+)))

;;; hello ends here


Re: btrfs and subvolumes for root

2017-09-05 Thread Fredrik Salomonsson
>
> Adjusting kernel parameters can be done with 'kernel-arguments'.

Thanks, missed that option when looking through the manual.

Been messing around with it for a few days trying to get this to work but
so far no luck.

I've made a few changes to my disk layout since my last email. Inspired by
this thread
https://lists.gnu.org/archive/html/help-guix/2016-03/msg00090.html

Partion layout for /dev/sda3
under __current/
| subvol  | Mountpoint   | Comment| Shared   |
|-+--++--|
| arch-root   | /| root for Arch  | no   |
| guixsd-root | /| root for GuixSD| no   |
| grub| /boot/grub   | grub config| yes  |
| guix| /var/guix| guix stuff | yes  |
| gnu | /gnu | Store etc  | yes  |
| home| /home| home partition | yes  |

My plan is to share guix between guixsd and arch similar to
what Christopher Allan Webber does except instead of using bind-mount I'm
using btrfs subvolumes. Then let GuixSD handle the grub generation.

The error I'm getting now is that it cannot find the linux kernel when
booting. Which I assume is because the gnu subvolume isn't mounted? I'm a
bit of a noob when it comes to the boot process.

I tried adding (needed-for-boot? #t) to the filesystems I need at boot. For
example
(file-system
  (device "root")
  (title 'label)
  (mount-point "/gnu")
  (type "btrfs")
  (options
"defaults,discard,compress=lzo,space_cache,autodefrag,subvol=__current/gnu")
  (needed-for-boot? #t)
  (dependencies mapped-devices))

But when I have that set to true, guix complains about missing
mapped-devices for my swap-device and for /home if I comment out
(swap-devices ...).

The error I get is:

> guix system: error: service 'swap-/dev/mapper/the-swap-device' requires
> 'device-mapping-the-swap-device', which is not provided by any service

And if I comment out (swap-devices '("/dev/mapper/the-swap-device")) in my
config.scm I get:

> guix system: error: service 'file-system-/home' requires
> 'device-mapping-the-root-device', which is not provided by any service


If I remove the (needed-for-boot? #t) from the file-system entries the
error goes away.

I tested this using the 0.13.0 img with no guix pull before running guix
system init. But I'm getting the same error when running guix system init
from my Arch linux install.

2017-09-02 4:34 GMT-07:00 Marius Bakke <mba...@fastmail.com>:

> m...@strahlungsfrei.de writes:
>
> > Am 2017-08-06 05:46, schrieb Fredrik Salomonsson:
> >> Hello Guix,
> >>
> >> I'm testing out setting up a dual boot between GuixSD and Arch. I've
> >> no idea how much each one will take on disk. I decided to try out
> >> btrfs and subvolumes for the layout.
> >>
> >> But I'm having some issues booting the thing.
> >>
> >> My disk layout right now is:
> >> sda
> >>   sda1  1MB BIOS boot
> >>   sda2  4G  swap
> >>   sda3 228.9GB  btrfs
> >>
> >> then subvolumes:
> >> sda3/
> >>   __current/guixsd-root
> >>   __current/arch-root
> >>   __current/boot
> >>   __current/home
> >>
> >> section from my config.scm, which is based on my old config (old one
> >> is attached).
> >>
> >> (file-systems (cons* (file-system
> >>(device "root")
> >>(title 'label)
> >>(mount-point "/boot")
> >>(options
> >> "defaults,discard,compress=lzo,space_cache,autodefrag,
> subvol=__current/boot")
> >>(dependecies mapped-devices))
> >> ;; repeat for guixsd-root and home but with correct value for subvol
> >> )
> >>
> >> guix system init worked fine but when booting it fails to locate the
> >> bzImage. Which I assume is because it doesn't know that the root is in
> >> a subvolume.
> >>
> >> Long story short. How do I add rootflags to GuixSD's grub menu entry?
> >> Need to add "rootflags=subvol=__current/guixsd-root" to the
> >> linux-arguments. Might be an issue of having boot as a subvolume as
> >> well.
> >>
> >> Thanks
> >>
> >> --
> >>
> >> s/Fred[re]+i[ck]+/Fredrik/g
> >
> > Hello Fredrik,
> >
> > I am having the same problem. Adjusting the kernel parameters for the
> > GuixSD kernel seems currently not supported.  Looking at the source code
> > though it looks like this could be achieved via manipulating the
> > "bootloader-configuration-menu-entries" list. (Still a scheme noob!)
>
> 

Re: Emacs font question

2017-08-21 Thread Fredrik Salomonsson
Thanks Niall,

fontconfig was indirectly installed so fc-cache wasn't in my
.guix-profile/bin instead it was using fc-cache on arch.

running:

guix package -i fontconfig
fc-cache -vfr

Fixed it.

Still curious on why it picked up Hack but not DejaVu, I assume it was
using Hack install on arch and not Guix.



2017-08-21 1:26 GMT-07:00 Niall Dooley <dool...@gmail.com>:

> Try installing fontconfig if not installed already and then refresh the
> font cache with
>
> fc-cache -f
>
> or
>
> fc-cache -vfr
>
> Relevant past discussions:
> https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00477.html
>
> <http://goog_2020154044>
> https://lists.gnu.org/archive/html/help-guix/2017-05/msg00021.html
>
> <http://goog_2020154045>
> https://lists.gnu.org/archive/html/help-guix/2017-02/msg00020.html
>
> HTH,
>
> Niall
>
> Niall
>
> On 21 August 2017 at 05:06, Fredrik Salomonsson <platt...@gmail.com>
> wrote:
>
>> Hi Guix,
>>
>> Working on setting up a dual boot with Guix+Arch Linux and GuixSD. Got it
>> running in Arch but having some issues with fonts in emacs. In my org mode
>> I have
>> set org-ellipsis to ⤵ (0x2935)
>>
>> Opening up emacs installed with pacman it renders correctly and doing C-u
>> C-x = over the character it tells me that it's using the font
>>
>>> display:
>>>
>> xft:-PfEd-DejaVu Serif-normal-normal-normal-*-12-*-*-*-*-0-iso10646-1
>>> (#xBB6)
>>>
>>
>> But opening up emacs installed with guix I just get a rectangle with the
>> unicode in it instead of the arrow. Doing C-u C-x = on it shows:
>>
>>> display: no font available
>>>
>>
>> I have font-dejavu, font-awesome, font-hack and font-gnu-freefont-ttf
>> install in guix.
>> My emacs config file is here:
>> https://github.com/plattfot/dotemacs/blob/master/init.d/configuration.org
>>
>> Using http://bluejamesbond.github.io/CharacterMap/
>> and browsing to .guix-profile/share/fonts/truetype/DejaVuSerif.ttf
>> I can see the character (index 2998, unicode 2935) so I'm not missing the
>> font.
>>
>> The weird part is that it's picking up Hack just fine. So I'm not sure
>> what I'm missing.
>>
>> Thanks
>>
>> --
>> s/Fred[re]+i[ck]+/Fredrik/g
>>
>
>


-- 
s/Fred[re]+i[ck]+/Fredrik/g


Emacs font question

2017-08-20 Thread Fredrik Salomonsson
Hi Guix,

Working on setting up a dual boot with Guix+Arch Linux and GuixSD. Got it
running in Arch but having some issues with fonts in emacs. In my org mode
I have
set org-ellipsis to ⤵ (0x2935)

Opening up emacs installed with pacman it renders correctly and doing C-u
C-x = over the character it tells me that it's using the font

> display:
>
xft:-PfEd-DejaVu Serif-normal-normal-normal-*-12-*-*-*-*-0-iso10646-1
> (#xBB6)
>

But opening up emacs installed with guix I just get a rectangle with the
unicode in it instead of the arrow. Doing C-u C-x = on it shows:

> display: no font available
>

I have font-dejavu, font-awesome, font-hack and font-gnu-freefont-ttf
install in guix.
My emacs config file is here:
https://github.com/plattfot/dotemacs/blob/master/init.d/configuration.org

Using http://bluejamesbond.github.io/CharacterMap/
and browsing to .guix-profile/share/fonts/truetype/DejaVuSerif.ttf
I can see the character (index 2998, unicode 2935) so I'm not missing the
font.

The weird part is that it's picking up Hack just fine. So I'm not sure what
I'm missing.

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g


Re: Issues with my configuration - zsh shell default

2017-07-05 Thread Fredrik Salomonsson
1)

> Do you want this to be mounted on boot?  I don’t think there’s a way to
> express that a mount should happen after the network has come up (yet).
>


You can only tell Guix not to try to mount the disk on boot.  Use
> auto-mounting to mount the disk on demand at a later point.  (We don’t
> have a service for autofs yet.)
>


Your contributions in this area would be welcome!


Ideally I would like it to be mounted on boot. Only thing I found was in
the mount manpage  which mention the
option _netdev. That will supposedly wait until the network is up before
mounting. But I'm not sure if GuixSD (Shepherd?) is using mount or not.

How do I mount it manually after boot? I see it's in the fstab but I cannot
run mount. It's complain about wrong fs type, bad option, bad superblock...
And mention that it might need a /sbin/mount. helper program. When I
run
sudo mount /media/Valhalla

I would love to contribute. But my experience with guile right now is
minimal. So my plan is to first familiarize myself with guile and guix by
first package up some stuff I notice are missing in guix that I use. Any
recommendations on books, tutorials etc on guile would be helpful.

2)

> There is no module “(gnu packages zsh)”.  “zsh” is now in “(gnu packages
> shells)”.



>  (use-package-modules shells)
>   (users (cons (user-account
> (name "admin")
> (comment "")
> (group "users")
> (supplementary-groups '("wheel" "netdev"
> "audio" "video"))
> (shell #~(string-append #$zsh "/bin/zsh"))
> (home-directory "/home/admin"))
>%base-user-accounts))


This worked for me. Thanks. What is the best way of looking up what package
belongs to what module? In case I hit more of this in the future.

3)

> Here’s what I do in my config:



--8<---cut here---start->8---
> (define dvorak-evdev
>   (call-with-input-file "/etc/config.d/evdev.conf" read-string))
>
> […]
> (operating-system …
>   (services …
> (modify-services %desktop-services
>   (slim-service-type
>config => (slim-configuration
>   (inherit config)
>   (startx (xorg-start-command
>#:configuration-file
>(xorg-configuration-file
> #:extra-config
> (list dvorak-evdev))
> …)))
> --8<---cut here---end--->8---
>
> You can use something like that to add to the xorg configuration file.
> Just put your snippet in a file and slurp it up.


Tried doing something similar but getting errors on the read-string.
First I got:
guix system: error: failed to load '/etc/config.scm':
/etc/config.scm:23:24: /etc/config.scm:23:24: In procedure module-lookup:
Unbound variable: read-string

After searching in the guile manual I found a read-string in the module
(sxml ssax input-parse), loaded that and now I get.
guix system: error: failed to load '/etc/config.scm':
sxml/upstream/input-parse.scm:318:11: In procedure read-string:
sxml/upstream/input-parse.scm:318:11: In procedure <: Wrong type: #

I'm probably missing something.
I've attached my new config.scm and xorg file.

> 4) /bin/env
> > In the manual, under Base Services
> >  it
> > describes how to add env to /bin. I tried adding that snippet to my
> > services but I don't see env in /bin after I reconfigure.


Not sure about this one.  Your config looks okay to me.  I’m not using
> this myself, so I don’t know if there’s a bug in our documentation.

It is working it was just me being stupid. I was looking in /bin for env,
but in my config it is set to /usr/bin/.

>> I've also noticed some odd issues with my keyboards that are running the
qmk
>> firmware . I've setup that my space
>> have a dual action, it's register as space when pressing and ctrl when
>> holding the key. But when using them in GuixSD it results in a 1s delay
>> every time I press space. Which gives a very sluggish impression when
>> typing in the terminal. It works fine if I disable that feature. I have
not
>> experienced that issue in any other distro.
>
> Don’t know about this one.  Is any kernel firmware loading mechanism
> involved or do you suspect an xorg configuration problem?

I'm not sure about this one either. No kernel firmware mechanism is
involved as far as I know, I think the firmware just mimics a plain old usb
keyboard. From what I understand the dual action keys should be happening
in the firmware and the kernel shouldn't even notice any of this. But
that's just my assumption. Need to debug this further before I can draw any
conclusion if it's GuixSD or if it's my laptop. Just thought I mention it
in case someone