Re: Registering an artifact as root

2023-08-09 Thread Hartmut Goebel

Am 23.07.23 um 14:38 schrieb Liliana Marie Prikler:
Hope that helps. 


Thanks, I was able to make this work:

guile -L .. -c '(use-modules (guix store)) (add-indirect-root 
(open-connection) "/abs/path/to/my/artifact")'


--
Regards
Hartmut Goebel

| Hartmut Goebel  | h.goe...@crazy-compilers.com   |
| www.crazy-compilers.com | compilers which you thought are impossible |




Re: Registering an artifact as root

2023-07-23 Thread Liliana Marie Prikler
Am Sonntag, dem 23.07.2023 um 12:51 +0200 schrieb Hartmut Goebel:
> Hi,
> I'd like to create a symlink to a store object somewhere in my home-
> directory and register this symlink as a root, to avoid the garbage
> collector removes the store object.
> How can I achieve this with existing guix means?
(guix store) has

(define-operation (add-indirect-root (string file-name))
  "Make the symlink FILE-NAME an indirect root for the garbage collector:
whatever store item FILE-NAME points to will not be collected.  Return #t on
success.

FILE-NAME can be anywhere on the file system, but it must be an absolute file
name--it is the caller's responsibility to ensure that it is an absolute file
name."
  boolean)

Hope that helps.

Cheers



Registering an artifact as root

2023-07-23 Thread Hartmut Goebel

  
  
Hi,
I'd like to create a symlink to a store object somewhere in my
  home-directory and register this symlink as a root, to avoid the
  garbage collector removes the store object.
How can I achieve this with existing guix means?

Background: Vagrant has the means of distributing virtual
  machines as "boxes", tar.gz files which are downloaded and then
  extracted into some cache directory. When Vagrant creates a
  virtual machine based on that box, it copies the disk-image to
  some working directory. The cache content is (almost) trivial,
  thus I wrote a small script creating the required files in the
  cache directory and sym-linking the disk-image there. Of course,
  the garbage collector should not remove the disk-image a long as
  it is used (= linked from the box cache).

-- 
Regards
Hartmut Goebel

| Hartmut Goebel  | h.goe...@crazy-compilers.com   |
| www.crazy-compilers.com | compilers which you thought are impossible |