unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: 45mg <45mg.writes@gmail.com>
To: 74819@debbugs.gnu.org
Subject: [bug#74819] [PATCH] services: elogind: Support Hook Directories
Date: Thu, 12 Dec 2024 08:00:51 -0500	[thread overview]
Message-ID: <87a5d1ys1o.fsf@gmail.com> (raw)
In-Reply-To: <7286c9dd75c4853f5811720150c027b9d9b511d7.1734003226.git.45mg.writes@gmail.com>

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


Here's how I tested these changes if anyone is interested:

- Add the files included here into a `testdir` directory
- Compile
  guix shell -D guix --pure -- make
- Test in a container (no loginctl sessions, but will catch obvious errors)
  sudo $(./pre-inst-env guix system container path/to/testdir/test-config.scm)
- Test in a VM (need --full-boot for the ability to suspend, etc)
  $(./pre-inst-env guix system vm --full-boot path/to/testdir/test-config.scm)


[-- Attachment #2: test-config.scm --]
[-- Type: application/octet-stream, Size: 1348 bytes --]

(use-modules (gnu)
             (gnu home)
             (gnu home services dotfiles))
(use-service-modules cups desktop networking ssh xorg)

(operating-system
  (locale "en_US.utf8")
  (timezone "America/New_York")
  (keyboard-layout (keyboard-layout "us"))
  (host-name "guix-test")

  (users (cons* (user-account
                  (name "user")
                  (comment "Non-root user")
                  (group "users")
                  (home-directory "/home/user")
                  (supplementary-groups '("wheel" "netdev" "audio" "video")))
                %base-user-accounts))

  (packages %base-packages)

  (services
   (append (list (service elogind-service-type
                          (elogind-configuration
                           (system-sleep-hook-files
                            (list
                             (local-file
                              "test-sleep-script"))))))
           %base-services))

  (bootloader (bootloader-configuration
                (bootloader grub-bootloader)
                (targets (list "/dev/sda"))
                (keyboard-layout keyboard-layout)))

  (file-systems (cons* (file-system
                         (mount-point "/")
                         (device (file-system-label "dummy"))
                         (type "ext4"))
                       %base-file-systems)))

[-- Attachment #3: test-sleep-script --]
[-- Type: application/octet-stream, Size: 52 bytes --]

#!/bin/sh
echo "$@" >> /root/elogind-test-sleep-log

  reply	other threads:[~2024-12-12 13:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 11:33 [bug#74819] [PATCH] services: elogind: Support Hook Directories 45mg
2024-12-12 13:00 ` 45mg [this message]
2024-12-16  6:26 ` [bug#74819] [PATCH v2] " 45mg
2024-12-16  6:37   ` 45mg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5d1ys1o.fsf@gmail.com \
    --to=45mg.writes@gmail.com \
    --cc=74819@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).