Hi,

On dim., 12 févr. 2023 at 16:39, Benton Edmondson <[email protected]> wrote:
> Hello,
>
> I see under <https://guix.gnu.org/cookbook/en/html_node/Guix-Containers.html>
> that it is possible to imperatively run programs in their own container. Is
> it possible to do this declaratively? In other words, can I create a
> derivation which generates a Guix Container, which I could then put in a
> manifest? I read around but didn't see documentation on this.

This example from the mentioned Cookbook,

  $ guix shell --container --network --manifest=manifest.scm -- R

is declarative, no?  Well, the profile is not “containerized”,

--8<---------------cut here---------------start------------->8---
$ guix shell hello coreutils
(env) $ echo $GUIX_ENVIRONMENT
/gnu/store/d5pz9lmmi9zr7l6zpj6z6708vsrwwv29-profile

$ guix shell hello coreutils --container
[env]$ echo $GUIX_ENVIRONMENT
/gnu/store/d5pz9lmmi9zr7l6zpj6z6708vsrwwv29-profile
--8<---------------cut here---------------end--------------->8---

and the container is created on the fly, then populated by the profile.
You are asking for another feature, IIUC, as described previously in
[1,2] and I guess you would like [3]. :-)

1: https://yhetil.org/guix/[email protected]
2: https://yhetil.org/guix/[email protected]
3: https://yhetil.org/guix/[email protected]

Or maybe you could be interested by:

https://guix.gnu.org/en/blog/2017/running-system-services-in-containers/


Cheers,
simon

Reply via email to