all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
To: Martin Baulig <martin@baulig.is>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: Postgres user UID and GID
Date: Mon, 17 Jul 2023 21:49:31 +0200	[thread overview]
Message-ID: <20230717214920.32382c6b@primary_laptop> (raw)
In-Reply-To: <RrD2cW7f4zIlLXNndtt5-Vx4fGP7EWc4qXRs5rDZSL4HnPFiiHQhMyV4tSGLQiLgcLt6bNpvh0wqL82cpw4Kw9r8VFLJfNlih1Y-WJlvprA=@baulig.is>

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

On Mon, 17 Jul 2023 18:06:04 +0000
Martin Baulig <martin@baulig.is> wrote:

> Hello,
Hi,

> I have a bit of an unusual setup, as I am running GNU Guix in a VM on
> a Synology NAS. Unfortunately, their DSM software sucks quite badly,
> but I am currently stuck with this hardware as I don't have the
> budget to replace it. But I don't want to make any long-term
> commitment to their software either. One of the awesome features of
> GNU Guix is that it can nicely and easily be deployed elsewhere.
> However, for this to work, I need to be able to extract my data
> easily, so storing anything inside that VM that's not on GitLab isn't
> an option. I have decided to NFS-mount an encrypted shared folder
> from the NAS and store all data there.
I've also a setup where I share a postgresql data folder between
various distributions.

In my case it's shared between Parabola i686, Parabola x86_64, Guix
i686 and Guix x86_64. And I often need to chroot inside Parabola so
this is why I need to use the same IDs (than Parabola).

So for keeping the same id across different distributions, I hardcoded
it in the users and groups like that in my system.scm:
>   (users (cons* [...]
>                 (user-account
>                   (name "postgres")
>                   (uid 88)
>                   (group "postgres")
>                   (comment "PostgreSQL user")
>                   (home-directory
> "/path/to/shared-dir/var/lib/postgres") (shell (file-append bash
> "/bin/bash")) (system? #t)) %base-user-accounts))

And in the groups too:
>   (groups (cons* [...]
>                  (user-group
>                    (name "postgres")
>                    (id 88)
>                    (system? #t))
>                  [...]
>                  %base-groups))

And for the record here's how I use a different architecture: I define
a package:
> (define postgresql-14-i686-linux
>   (package                    
>    (inherit postgresql-14)  
>    (name "postgresql-14-i686-linux")
>    (arguments
>     (ensure-keyword-arguments
>      (package-arguments postgresql-14)
>      '(#:system "i686-linux")))))

And then use it in the PostgreSQL service:
>                    (service
>                      postgresql-service-type
>                      (postgresql-configuration
>                       (postgresql
>                        (if (target-x86-64?)
>                            postgresql-14-i686-linux
>                            postgresql-14))
>                       [...]))

The downside is that it prints a warning during boot if I recall
well but it works fine.

I'm unsure if that helps the conversation or not though as you might
want something cleaner.

Denis.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-07-17 19:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 18:06 Postgres user UID and GID Martin Baulig
2023-07-17 19:49 ` Denis 'GNUtoo' Carikli [this message]
2023-07-17 21:35   ` Martin Baulig
2023-07-18 22:10     ` Denis 'GNUtoo' Carikli
2023-07-19 14:35       ` Martin Baulig
2023-07-17 20:23 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-07-17 21:28   ` Martin Baulig

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

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

  git send-email \
    --in-reply-to=20230717214920.32382c6b@primary_laptop \
    --to=gnutoo@cyberdimension.org \
    --cc=guix-devel@gnu.org \
    --cc=martin@baulig.is \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.