bug#60494: git-reference does not support file:// uri scheme

2023-01-02 Thread mirai
I'd like to build some specific programs that are git managed but not uploaded 
anywhere as packages in guix.
The rationale for this is that they're either too specific to be worth 
publishing or the programs are still
in their very early stages of development.

Using the file:// scheme in a package object does not work and the only 
workaround is passing the "--with-source=..."
command-line argument to 'guix build' which is rather selective in what it 
accepts, namely it does not work with bare repositories
meaning that a redundant git clone needs to be done beforehand.





bug#60383: Pulseaudio does not source 'extra-script'files' from pulseaudio-configuration

2022-12-28 Thread mirai
Pulseaudio ignores any files under /etc/pulse/default.pa.d/ even though 
according to /etc/pulse/default.pa
this shouldn't be the case:

--8<---cut here---start->8---
$ cat /etc/pulse/default.pa
#!/gnu/store/5nfmdrmm6zp4c3a5g5w5gwp7z39dr09n-pulseaudio-15.0/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio 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 Lesser General Public License
# along with PulseAudio; if not, see .

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev 
support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 
sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor


### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
#load-module module-console-kit

.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
.nofail
.include 
/gnu/store/5nfmdrmm6zp4c3a5g5w5gwp7z39dr09n-pulseaudio-15.0/etc/pulse/default.pa.d

### Added by Guix to include scripts specified in extra-script-files.
.nofail
.include /etc/pulse/default.pa.d

--8<---cut 

bug#60300: (Premature networking started status with NetworkManager)

2022-12-27 Thread mirai
Looking into NetworkManager documentation, it looks like the 'networking service
provided by Guix does not implement the NetworkManager's systemd equivalent. [1]

Namely, NetworkManager has some specific steps until it can be considered up 
and running/"startup complete". [1]
This process seems mostly dependent on nm-online to query the actual 
NetworkManager state. [2]

[1]: 
https://networkmanager.dev/docs/api/latest/NetworkManager-wait-online.service.html
[2]: https://networkmanager.dev/docs/api/latest/nm-online.html





bug#60300: Premature networking started status with NetworkManager

2022-12-24 Thread mirai
If a service has a requirement on 'networking
(either from accepting a shepherd-requirements field from its configuration 
record-type or
from the service-type definition) and networking is provided by NetworkManager, 
it will not
work as intended. This is because networking is prematurely flagged as started 
before
NetworkManager can finish its startup.

Some of the visible consequences resulting from this is service startup failure
for OpenSMTPD when it's configured with a non-loopback interface and has a 
dependency on 'networking
placed using shepherd-requirement field.
A similar situation happens with nginx, failure to start the service or ignored 
directives that
want to resolve domains over DNS.

These failures do not happen if one creates a one-shot simple-service that puts 
a dependency on networking
and simply waits approx. 10-30 seconds and have nginx-service-type or 
opensmptd-service-type depend on it
instead.

>From /var/log/messages (truncated to relevant parts):

--8<---cut here---start->8---
Dec 21 22:19:01 localhost shepherd[1]: Service networking has been started. 
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6330] 
NetworkManager (version 1.41.2) is starting... (asserts:100, 
boot:502a84f9-92cc-47a9-a86c-97ec819fb23a)
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6331] Read 
config: /gnu/store/3cp48fvxfivj2255bbxj7363qj33ajs9-NetworkManager.conf
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6340] 
bus-manager: acquired D-Bus service "org.freedesktop.NetworkManager"
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6353] 
manager[0xc85080]: monitoring kernel firmware directory '/lib/firmware'.
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6357] 
hostname: hostname: couldn't get property from hostnamed
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6358] 
hostname: static hostname changed from (none) to "doll"
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6363] 
dns-mgr: init: dns=default,systemd-resolved rc-manager=resolvconf (auto)
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6365] 
manager[0xc85080]: rfkill: Wi-Fi hardware radio set enabled
Dec 21 22:19:01 localhost NetworkManager[473]:   [1671661141.6365] 
manager[0xc85080]: rfkill: WWAN hardware radio set enabled
[...]
Dec 21 22:19:30 localhost shepherd[1]: Service nscd has been started. 
Dec 21 22:19:30 localhost shepherd[1]: [NetworkManager] Service nscd has been 
stopped. 
Dec 21 22:19:30 localhost shepherd[1]: [NetworkManager] Service nscd has been 
started. 
Dec 21 22:19:30 localhost dbus-daemon[470]: [system] Activating service 
name='org.freedesktop.nm_dispatcher' requested by ':1.1' (uid=0 pid=473 
comm="/gnu/store/ghf1miwbxfcz33mx9bccllgf257vvfhp-networ") (using servicehelper)
Dec 21 22:19:30 localhost NetworkManager[473]:   [1671661170.2951] device 
(enp4s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 
'managed')
Dec 21 22:19:30 localhost dbus-daemon[470]: [system] Successfully activated 
service 'org.freedesktop.nm_dispatcher'
Dec 21 22:19:30 localhost NetworkManager[473]:   [1671661170.2995] device 
(enp4s0): state change: ip-check -> secondaries (reason 'none', 
sys-iface-state: 'managed')
Dec 21 22:19:30 localhost NetworkManager[473]:   [1671661170.2996] device 
(enp4s0): state change: secondaries -> activated (reason 'none', 
sys-iface-state: 'managed')
Dec 21 22:19:30 localhost NetworkManager[473]:   [1671661170.2998] 
manager: NetworkManager state is now CONNECTED_SITE
Dec 21 22:19:30 localhost NetworkManager[473]:   [1671661170.2999] device 
(enp4s0): Activation: successful, device activated.
Dec 21 22:19:30 localhost NetworkManager[473]:   [1671661170.3001] 
manager: NetworkManager state is now CONNECTED_GLOBAL
Dec 21 22:19:30 localhost NetworkManager[473]:   [1671661170.3003] 
manager: startup complete
--8<---cut here---end--->8---


It's apparent that 'networking should be flagged started only after 
NetworkManager logs "startup complete".





bug#60246: Inability to add pseudo-filesystem fstab entries

2022-12-21 Thread mirai
Hi,

On 2022-12-21 22:50, Tobias Geerinckx-Rice wrote:
> 
> If the following is really true, we have little other choice:
> 
>> ;; In particular, things like GIO (part of GLib) use it to determine the set
>> ;; of mounts, which is then used by graphical file managers and desktop
>> ;; environments to display "volume" icons.  Thus, we really need to exclude
>> ;; those pseudo file systems from the list. 

If that's the case, an approach for these "unspeakable" file-systems whose 
presence must not be recorded in fstab
would be to at least "generate" some file-system- shepherd services (and have 
them enabled/disabled according to mount? value).
This way there's at least a way to "start" these mounts rather than them ending 
up in the /dev/null abyss.





bug#60246: Inability to add pseudo-filesystem fstab entries

2022-12-21 Thread mirai
An entry of the form:

--8<---cut here---start->8---
  (file-system
(mount-point "/media/foo-mount")
(create-mount-point? #t)
(mount? #f)
(device "none")
(type "overlay")
(flags '(no-atime no-dev no-suid no-exec read-only))
(options (string-append "lowerdir="
(string-join '("/srv/foo/overlays/bar"
   "/srv/foo/overlays/baz") ":")))
(check? #f))
--8<---cut here---end--->8---

Does not result in a fstab entry line, which makes it impossible to mount. 
According to Guix docs, this shouldn't be the case:

--8<---cut here---start->8---
mount? (default: #t)

This value indicates whether to automatically mount the file system when 
the system is brought up. When set to #f, the file system gets an entry in 
/etc/fstab (read by the mount command) but is not automatically mounted.
--8<---cut here---end--->8---

Looking at gnu/services/base.scm there's this snippet:

--8<---cut here---start->8---
(define (file-system-fstab-entries file-systems)
  "Return the subset of @var{file-systems} that should have an entry in
@file{/etc/fstab}."
  ;; /etc/fstab is about telling fsck(8), mount(8), and umount(8) about
  ;; relevant file systems they'll have to deal with.  That excludes "pseudo"
  ;; file systems.
  ;;
  ;; In particular, things like GIO (part of GLib) use it to determine the set
  ;; of mounts, which is then used by graphical file managers and desktop
  ;; environments to display "volume" icons.  Thus, we really need to exclude
  ;; those pseudo file systems from the list.
  (remove (lambda (file-system)
(or (member (file-system-type file-system)
%pseudo-file-system-types)
(memq 'bind-mount (file-system-flags file-system
  file-systems))
--8<---cut here---end--->8---

That seems to remove such pseudo-fs entries, regardless of 'mount?' value.
This is not a "documentation" bug, as there are valid uses for having pseudo-fs 
entries.

Right now I'm trying to add an overlayfs mount that is layered over a NFS 
system and
Guix doesn't exactly deal very well with mounting NFS as it depends on 
networking. To sidestep this,
I am mounting the NFS volume through a simple-service that puts a dependency on 
networking.

>From here the fstab problem begins: since it can't be mounted at boot 
>"conventionally", it is set
as mount? #f with the intention to mount it later via "mount /media/foo-mount" 
after NFS volume is ready
but since this entry does not end up in /etc/fstab, there's no way to mount it.





bug#57589: Guix hands on GDM with wayland

2022-12-01 Thread mirai
Grigory Shepelev wrote on 21 Nov 03:43 +0100:

> Figured out what was the problem. The /tmp dir. Once I had nonexisting /mnt
> dir on Guix boot. So I've added this piece In my file-systems:
> 
> (file-system
>   (mount-point "/tmp")
>   (device "tmp")
>   (type "tmpfs")
>   (check? #f))
> 
> This exact piece was causing a problem. Seems like it's connected to
> x11-socket-directory-service from (gnu services desktop). So, maybe the
> tmpdir was mounted after GDM boot and override the needed /tmp settings.

This might not be the case (like you, I'm also
using tmpfs for /tmp as mentioned in https://issues.guix.gnu.org/57589#9).
I've wrote a small guix system test for testing out this tmpfs theory at
https://issues.guix.gnu.org/59739 and so far, all the tests pass, with or 
without
/tmp as tmpfs mount.

Can you share your 'loginctl show-user gdm' and
'loginctl show-session ' output (before logging in with gdm, 
you
can do this via ssh or switch to another tty) and your system specs/GPU make?







bug#59423: Invalid 'location' field generated in dovecot configuration

2022-11-25 Thread mirai
I'm also experiencing the same issue (guix describe: 
7e0ad0dd0f2829d6f3776648ba7c88acf9888d7a).

My guess is that 44554e7133aa60e1b453436be1e80394189cabd9 (which supersedes 
543d971ed2a1d9eb934af1f51930741d7cc4e7ef)
introduces a '%location' field which conflicts with 'dovecot-configuration' 
itself also having a field called 'location'.

In fact, interesting things happen if you define a configuration with a 
'location' field.
With 'guix repl':
```
$ guix repl
GNU Guile 3.0.8
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> (use-modules (gnu services configuration))
(define-configuration FOO-configuration
  (name
   (string "aaa")
   "")
  (location
   (string "bbb")
   ""))
;;; :2:0: warning: shadows previous definition of 
`%FOO-configuration-location-procedure' at :2:0
;;; : warning: shadows previous definition of 
`FOO-configuration-location' at 
;;; :2:0: warning: possibly unbound variable `serialize-string'
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: serialize-string: unbound variable

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guix-user) [1]>
```

Code snippet for convenience:
```
(use-modules (gnu services configuration))
(define-configuration FOO-configuration
  (name
   (string "aaa")
   "")
  (location
   (string "bbb")
   ""))
```





bug#57589: Guix hands on GDM with wayland

2022-11-24 Thread mirai
I believe I'm in a similar situation here.

Like Grigory, I also have my /tmp directory mounted as tmpfs:
```
(file-system
  (mount-point "/tmp")
  (device "none")
  (type "tmpfs")
  (flags '(no-dev no-suid no-atime))
  (check? #f))
```

But GDM launches in X11 mode as seen with 'loginctl show-session'
```
$ loginctl list-sessions 
SESSION  UID USER SEAT  TTY 
 c2  977 gdm  seat0 tty7
 c3 1000 x
$ loginctl show-session c2
Id=c2
User=977
Name=gdm
Timestamp=Wed 2022-11-23 17:02:57 WET
TimestampMonotonic=12113524
VTNr=7
Seat=seat0
TTY=tty7
Remote=no
Service=gdm-launch-environment
Leader=548
Audit=4294967295
Type=x11
Class=greeter
Active=yes
State=active
IdleHint=yes
IdleSinceHint=1669223280659646
IdleSinceHintMonotonic=314277878
LockedHint=no
```

and the DE/WM selection list does not contain any 'Wayland' option.

For reference, GDM was configured with:
```
(modify-services %desktop-services
  (gdm-service-type config => (gdm-configuration
   (inherit config)
   (wayland? #t)
   (auto-suspend? #f
```





bug#59515: nginx: Fails to start on boot while upstream service is not yet running

2022-11-23 Thread mirai
nginx-configuration has a 'shepherd-requirement' parameter that can be used here