unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Installing packages auto-container'ed
@ 2020-07-01 19:41 Christopher Lemmer Webber
  2020-07-01 20:17 ` Pierre Neidhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christopher Lemmer Webber @ 2020-07-01 19:41 UTC (permalink / raw)
  To: guix-devel

Would it be possible to make launching applications in Guix with minimum
permissions even easier?  Here's just a sketch of an idea.

Borrowing from the new containerizing an application example in the
manual...

In my manifest.scm, what if instead of listing the browser package
eolie, I listed the following:

  (define containerized-eolie
    (wrap-containerized eolie
                        #:network? #t
                        ;; Not sure if this line would be needed.
                        #:other-packages (list coreutils nss-certs dbus)
                        #:expose '("/etc/machine-id")
                        #:share '(("/home/cwebber/tmp/shared-with-browser"
                                   . "/home/cwebber/shared"))
                        #:share-env '("DISPLAY")))

  ;; now here's my list of packages
  (list emacs
        containerized-eolie
        ...)

The idea here is that containerized-eolie actually generates a new
package that "wraps" every binary that would be installed, as well as
all common launchers, to use a script that actually launches them in a
container with the above restrictions.
                      
I'm not sure how feasible or easy this is, but it seems like a good
idea.

If the process of containerizing something tricky like icecat is fairly
common, we could abstract that into a procedure, like
(make-containerized-icecat ...) or something.

Thoughts?

 - Chris


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Installing packages auto-container'ed
  2020-07-01 19:41 Installing packages auto-container'ed Christopher Lemmer Webber
@ 2020-07-01 20:17 ` Pierre Neidhardt
  2020-07-01 22:31 ` Ludovic Courtès
  2020-07-02  9:20 ` L p R n d n
  2 siblings, 0 replies; 4+ messages in thread
From: Pierre Neidhardt @ 2020-07-01 20:17 UTC (permalink / raw)
  To: Christopher Lemmer Webber, guix-devel

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

I'd love this!
Does not seem to hard, but maybe I'm missing something.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Installing packages auto-container'ed
  2020-07-01 19:41 Installing packages auto-container'ed Christopher Lemmer Webber
  2020-07-01 20:17 ` Pierre Neidhardt
@ 2020-07-01 22:31 ` Ludovic Courtès
  2020-07-02  9:20 ` L p R n d n
  2 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2020-07-01 22:31 UTC (permalink / raw)
  To: Christopher Lemmer Webber; +Cc: guix-devel

Hi Chris!

Christopher Lemmer Webber <cwebber@dustycloud.org> skribis:

> Would it be possible to make launching applications in Guix with minimum
> permissions even easier?  Here's just a sketch of an idea.
>
> Borrowing from the new containerizing an application example in the
> manual...
>
> In my manifest.scm, what if instead of listing the browser package
> eolie, I listed the following:
>
>   (define containerized-eolie
>     (wrap-containerized eolie
>                         #:network? #t
>                         ;; Not sure if this line would be needed.
>                         #:other-packages (list coreutils nss-certs dbus)
>                         #:expose '("/etc/machine-id")
>                         #:share '(("/home/cwebber/tmp/shared-with-browser"
>                                    . "/home/cwebber/shared"))
>                         #:share-env '("DISPLAY")))
>
>   ;; now here's my list of packages
>   (list emacs
>         containerized-eolie
>         ...)
>
> The idea here is that containerized-eolie actually generates a new
> package that "wraps" every binary that would be installed, as well as
> all common launchers, to use a script that actually launches them in a
> container with the above restrictions.

Definitely, it’s a great idea!

The ‘wrap-containerized’ procedure above wouldn’t be hard to write
((guix scripts pack) has something similar).  It could use a trick as in
<https://lists.gnu.org/archive/html/help-guix/2018-01/msg00118.html> to
automatically determine some of the default file system mappings.

The next step I think would be to make a package transformation option
for that, so one could say:

  guix install eolie --contained=eolie

or similar.

Ludo’.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Installing packages auto-container'ed
  2020-07-01 19:41 Installing packages auto-container'ed Christopher Lemmer Webber
  2020-07-01 20:17 ` Pierre Neidhardt
  2020-07-01 22:31 ` Ludovic Courtès
@ 2020-07-02  9:20 ` L p R n d n
  2 siblings, 0 replies; 4+ messages in thread
From: L p R n d n @ 2020-07-02  9:20 UTC (permalink / raw)
  To: Christopher Lemmer Webber; +Cc: guix-devel


Hello,

I like it.
To be honest, I tried to write something like that a year ago or so, I think.
I used call-with-container with weird imports/modules and it's globally
very ugly and a mess... I could share it if you want but it's probably
useless now, specially if there is some proper code in (guix pack).

Also I tried to make a variant for softwares needing FHS (binaries,
really...). Would it be possible/interesting to get that kind of feature
too?

And +1 too for the command-line option. :)

Have a nice day,

L  p R n  d n


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-02  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 19:41 Installing packages auto-container'ed Christopher Lemmer Webber
2020-07-01 20:17 ` Pierre Neidhardt
2020-07-01 22:31 ` Ludovic Courtès
2020-07-02  9:20 ` L p R n d n

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).