unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Sergiu Ivanov <sivanov@colimite.fr>
To: phodina <phodina@protonmail.com>
Cc: help-guix@gnu.org
Subject: Re: Installing file outside package in /etc
Date: Sat, 24 Apr 2021 16:44:52 +0200	[thread overview]
Message-ID: <87r1izvj17.fsf@colimite.fr> (raw)
In-Reply-To: <dVfwn-h08UkYk38jgrhlhw3bTvyzwf7l92F9QlO6JK7dV-d8xiIbLENKexKT44TqzDWgd17n5PWFm2YPjrS8NQmuTPoG4y2KK25lEYceAaM=@protonmail.com>

Hi,

Guix beginner here.

Thus quoth  phodina via  on Sat Apr 24 2021 at 11:30 (+0200):
> I'm creating a package for application which needs to install file
> outside of the derivation directory.
>
> The file in question is /etc/sudoers.d but it can be generalized for
> other things like udev etc. I understand this won't be trivial since
> it modifies the system and will probably require some wrapper with
> higher privileges. However, I could not find any section in the Guix
> reference Manual.
>
> The file is installed in the install phase. Is it the right phase or
> shall I use different? If so how do I patch it?

From what I understand of Guix/Nix, you would have to modify the
definition of your operating-system (in /etc/config.scm) to install
a file under /etc/, which is clearly not what you are trying to achieve.

I have the impression that modifying files outside the output directory
is out of the scope of Guix/Nix packages, which is probably why the Guix
manual doesn't even speak about that problem.

Maybe some more experienced people have better advice.

> Also if I compare the contents of GuixSD to NixOS, then the NixOS has
> more files linked to /etc/static/ which then links to
> /nix/store. Could somebody please explain what were/are the thoughts
> behind this?

I checked /etc/static on two machines, one running Guix System and the
other one NixOS, and it looks to me that those symlinks contain the
static (duh) parts of the configurations, which are generated from the
corresponding operating system definitions.  These files are put into
the store and are not supposed to be changed other than by changing the
definitions of the operating system.

I have the impression that Nix links every single static file to a file
in the store, while Guix only links directories.  For example, on my
Guix System, /etc/hostname is a normal file, while on NixOS it is
a symlink to /etc/static/hostname.  This should explain the difference
in the number of symlinks.

Note however that /etc/hostname appearing to be a normal file may be
misleading, since it may also be a hardlink to a file in the store.
It is beyond my knowledge/motivation to figure out whether it really is
or not :-)

-
Sergiu


  reply	other threads:[~2021-04-24 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24  9:30 Installing file outside package in /etc phodina via
2021-04-24 14:44 ` Sergiu Ivanov [this message]
2021-04-28 11:02   ` Utkarsh Singh
2021-04-28 11:05     ` Sergiu Ivanov

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=87r1izvj17.fsf@colimite.fr \
    --to=sivanov@colimite.fr \
    --cc=help-guix@gnu.org \
    --cc=phodina@protonmail.com \
    /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.
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).