GNU bug report logs -
#62274
[PATCH] home: 'home-environment-with-provenance' uses the HE location info.
Previous Next
Reported by: Sergey Trofimov <sarg <at> sarg.org.ru>
Date: Sun, 19 Mar 2023 15:46:01 UTC
Severity: normal
Tags: patch
Done: Andrew Tropin <andrew <at> trop.in>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62274 in the body.
You can then email your comments to 62274 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
paren <at> disroot.org, andrew <at> trop.in, ludo <at> gnu.org, guix-patches <at> gnu.org
:
bug#62274
; Package
guix-patches
.
(Sun, 19 Mar 2023 15:46:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Sergey Trofimov <sarg <at> sarg.org.ru>
:
New bug report received and forwarded. Copy sent to
paren <at> disroot.org, andrew <at> trop.in, ludo <at> gnu.org, guix-patches <at> gnu.org
.
(Sun, 19 Mar 2023 15:46:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* gnu/home.scm (home-environment-with-provenance): Make `config-file`
optional, with the default taken from the HE location info.
---
gnu/home.scm | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/gnu/home.scm b/gnu/home.scm
index 6d3f705758..2fefe7ba53 100644
--- a/gnu/home.scm
+++ b/gnu/home.scm
@@ -103,7 +103,21 @@ (define* (home-environment-derivation he)
#:target-type home-service-type)))
(service-value home)))
-(define* (home-environment-with-provenance he config-file)
+
+(define (home-environment-configuration-file he)
+ "Return the configuration file of HE, based on its 'location' field, or #f
+if it could not be determined."
+ (let ((file (and=> (home-environment-location he)
+ location-file)))
+ (and file
+ (or (and (string-prefix? "/" file) file)
+ (search-path %load-path file)))))
+
+(define* (home-environment-with-provenance he
+ #:optional
+ (config-file
+ (home-environment-configuration-file
+ he)))
"Return a variant of HE that stores its own provenance information,
including CONFIG-FILE, if available. This is achieved by adding an instance
of HOME-PROVENANCE-SERVICE-TYPE to its services."
--
2.39.2
Reply sent
to
Andrew Tropin <andrew <at> trop.in>
:
You have taken responsibility.
(Mon, 20 Mar 2023 06:54:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Sergey Trofimov <sarg <at> sarg.org.ru>
:
bug acknowledged by developer.
(Mon, 20 Mar 2023 06:54:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 62274-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2023-03-19 16:45, Sergey Trofimov wrote:
> * gnu/home.scm (home-environment-with-provenance): Make `config-file`
> optional, with the default taken from the HE location info.
> ---
> gnu/home.scm | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/home.scm b/gnu/home.scm
> index 6d3f705758..2fefe7ba53 100644
> --- a/gnu/home.scm
> +++ b/gnu/home.scm
> @@ -103,7 +103,21 @@ (define* (home-environment-derivation he)
> #:target-type home-service-type)))
> (service-value home)))
>
> -(define* (home-environment-with-provenance he config-file)
> +
> +(define (home-environment-configuration-file he)
> + "Return the configuration file of HE, based on its 'location' field, or #f
> +if it could not be determined."
> + (let ((file (and=> (home-environment-location he)
> + location-file)))
> + (and file
> + (or (and (string-prefix? "/" file) file)
> + (search-path %load-path file)))))
> +
> +(define* (home-environment-with-provenance he
> + #:optional
> + (config-file
> + (home-environment-configuration-file
> + he)))
> "Return a variant of HE that stores its own provenance information,
> including CONFIG-FILE, if available. This is achieved by adding an instance
> of HOME-PROVENANCE-SERVICE-TYPE to its services."
Thank you for the patch, applied and pushed as
1f36534c7e8f2325bff4df5d37ecc811dc63fc38.
--
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#62274
; Package
guix-patches
.
(Mon, 20 Mar 2023 17:34:03 GMT)
Full text and
rfc822 format available.
Message #13 received at 62274 <at> debbugs.gnu.org (full text, mbox):
Hi Sergey and all,
Sergey Trofimov <sarg <at> sarg.org.ru> skribis:
> * gnu/home.scm (home-environment-with-provenance): Make `config-file`
> optional, with the default taken from the HE location info.
[...]
> +(define* (home-environment-with-provenance he
> + #:optional
> + (config-file
> + (home-environment-configuration-file
> + he)))
AFAICS, there’s only one call site for
‘home-environment-with-provenance’, and it passes two arguments. Thus,
the default value added by this patch will never be used.
Am I missing something?
Thanks,
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#62274
; Package
guix-patches
.
(Mon, 20 Mar 2023 19:09:01 GMT)
Full text and
rfc822 format available.
Message #16 received at 62274 <at> debbugs.gnu.org (full text, mbox):
Hi Ludovic,
> Hi Sergey and all,
>
> Sergey Trofimov <sarg <at> sarg.org.ru> skribis:
>
>> * gnu/home.scm (home-environment-with-provenance): Make
>> `config-file`
>> optional, with the default taken from the HE location info.
>
> [...]
>
>> +(define* (home-environment-with-provenance he
>> + #:optional
>> + (config-file
>> +
>> (home-environment-configuration-file
>> + he)))
>
> AFAICS, there’s only one call site for
> ‘home-environment-with-provenance’, and it passes two arguments.
> Thus,
> the default value added by this patch will never be used.
>
> Am I missing something?
You're right, the new signature is not used anywhere yet. Though
I'm working on a patch to embed home profiles in disk images
produced with `guix system image`. That's where this method comes
handy, see example usage:
(image
(inherit efi-disk-image)
(operating-system (operating-system-with-provenance (load
"./system.scm")))
(inputs
`(("guix-home"
,(home-environment-with-provenance (load "./home.scm")))))
(partition-table-type 'gpt)
(volatile-root? #false))
Information forwarded
to
guix-patches <at> gnu.org
:
bug#62274
; Package
guix-patches
.
(Tue, 21 Mar 2023 09:45:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 62274 <at> debbugs.gnu.org (full text, mbox):
Hi,
Sergey Trofimov <sarg <at> sarg.org.ru> skribis:
> You're right, the new signature is not used anywhere yet. Though I'm
> working on a patch to embed home profiles in disk images produced with
> `guix system image`. That's where this method comes handy, see example
> usage:
OK, interesting!
(In general I think it’s best to submit the new interface and its user
together, so reviewers get an overview of where this is going.)
Thanks,
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#62274
; Package
guix-patches
.
(Tue, 21 Mar 2023 10:57:01 GMT)
Full text and
rfc822 format available.
Message #22 received at 62274 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2023-03-20 20:03, Sergey Trofimov wrote:
> Hi Ludovic,
>
>> Hi Sergey and all,
>>
>> Sergey Trofimov <sarg <at> sarg.org.ru> skribis:
>>
>>> * gnu/home.scm (home-environment-with-provenance): Make
>>> `config-file`
>>> optional, with the default taken from the HE location info.
>>
>> [...]
>>
>>> +(define* (home-environment-with-provenance he
>>> + #:optional
>>> + (config-file
>>> +
>>> (home-environment-configuration-file
>>> + he)))
>>
>> AFAICS, there’s only one call site for
>> ‘home-environment-with-provenance’, and it passes two arguments.
>> Thus,
>> the default value added by this patch will never be used.
>>
>> Am I missing something?
>
> You're right, the new signature is not used anywhere yet. Though
> I'm working on a patch to embed home profiles in disk images
> produced with `guix system image`. That's where this method comes
> handy, see example usage:
>
> (image
> (inherit efi-disk-image)
> (operating-system (operating-system-with-provenance (load
> "./system.scm")))
> (inputs
> `(("guix-home"
> ,(home-environment-with-provenance (load "./home.scm")))))
> (partition-table-type 'gpt)
> (volatile-root? #false))
Also, take a look at this thread:
https://yhetil.org/63960cf762aec1ed2c4182f49cac66bc37fce2aa.camel <at> rdmp.org
and this prototype:
https://git.sr.ht/~abcdw/rde/tree/044de83e980b7038b87d27a090aef24229df85eb/src/gnu/services/home.scm#L1
It can be related to what you want to achieve, whithout modifying
image-related code.
--
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#62274
; Package
guix-patches
.
(Tue, 21 Mar 2023 12:31:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 62274 <at> debbugs.gnu.org (full text, mbox):
Hi Andrew,
Andrew Tropin <andrew <at> trop.in> writes:
> [[PGP Signed Part:Undecided]]
> On 2023-03-20 20:03, Sergey Trofimov wrote:
>
>>
>> You're right, the new signature is not used anywhere yet.
>> Though
>> I'm working on a patch to embed home profiles in disk images
>> produced with `guix system image`. That's where this method
>> comes
>> handy, see example usage:
>>
>
> Also, take a look at this thread:
> https://yhetil.org/63960cf762aec1ed2c4182f49cac66bc37fce2aa.camel <at> rdmp.org
>
> and this prototype:
> https://git.sr.ht/~abcdw/rde/tree/044de83e980b7038b87d27a090aef24229df85eb/src/gnu/services/home.scm#L1
>
> It can be related to what you want to achieve, whithout
> modifying
> image-related code.
Brilliant! That's it. It didn't come to me that `home-environment`
could be a dependency of `operating-system` and not of the image
itself. And you also made the service to activate it, so no manual
step is required. That's exactly what I have envisioned. What
prevents you to mainline it? It seems you have already
battle-tested it.
The only concern is that I'd rather include
`guix-home-service-type` only in the first generation of the
system. I think that this tie between user envs and the operating
system makes sense only on the first boot. Later on the users
should be responsible (and able to) to maintain their environments
independently.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#62274
; Package
guix-patches
.
(Tue, 21 Mar 2023 13:39:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 62274 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 2023-03-21 13:22, Sergey Trofimov wrote:
> Hi Andrew,
>
> Andrew Tropin <andrew <at> trop.in> writes:
>
>> [[PGP Signed Part:Undecided]]
>> On 2023-03-20 20:03, Sergey Trofimov wrote:
>>
>>>
>>> You're right, the new signature is not used anywhere yet.
>>> Though
>>> I'm working on a patch to embed home profiles in disk images
>>> produced with `guix system image`. That's where this method
>>> comes
>>> handy, see example usage:
>>>
>>
>> Also, take a look at this thread:
>> https://yhetil.org/63960cf762aec1ed2c4182f49cac66bc37fce2aa.camel <at> rdmp.org
>>
>> and this prototype:
>> https://git.sr.ht/~abcdw/rde/tree/044de83e980b7038b87d27a090aef24229df85eb/src/gnu/services/home.scm#L1
>>
>> It can be related to what you want to achieve, whithout
>> modifying
>> image-related code.
>
> Brilliant! That's it. It didn't come to me that `home-environment`
> could be a dependency of `operating-system` and not of the image
> itself. And you also made the service to activate it, so no manual
> step is required. That's exactly what I have envisioned. What
> prevents you to mainline it? It seems you have already
> battle-tested it.
>
> The only concern is that I'd rather include
> `guix-home-service-type` only in the first generation of the
> system. I think that this tie between user envs and the operating
> system makes sense only on the first boot. Later on the users
> should be responsible (and able to) to maintain their environments
> independently.
There are a few issues I've not addressed yet:
1. User can login before activation finished. (Discussed in the
mentioned thread above).
2. Do we need to activate it on every system reconfigure? (Actually, I
used it mostly for creating rde live cd and vm images, so didn't test
much with system reconfigure or guix deploy. Also, I guess it would be
cool to add a one-shot? flag to the service for skeleton like
functionality/initial provisioning).
3. Probably something else I already forgot.
I still don't have enough spare time to clean it up, test and upstream,
but if you would like to finish this thing up, I would be very happy to
help!
--
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#62274
; Package
guix-patches
.
(Tue, 21 Mar 2023 19:09:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 62274 <at> debbugs.gnu.org (full text, mbox):
Andrew Tropin <andrew <at> trop.in> writes:
> [[PGP Signed Part:Undecided]]
> On 2023-03-21 13:22, Sergey Trofimov wrote:
>>
>> The only concern is that I'd rather include
>> `guix-home-service-type` only in the first generation of the
>> system. I think that this tie between user envs and the
>> operating
>> system makes sense only on the first boot. Later on the users
>> should be responsible (and able to) to maintain their
>> environments
>> independently.
>
> There are a few issues I've not addressed yet:
>
> 1. User can login before activation finished. (Discussed in the
> mentioned thread above).
Yeah, I've just tried to bake a disk-image and also was able to
log in faster than the activation service finishes. Not a big deal
though, I can live with that.
>
> 2. Do we need to activate it on every system reconfigure?
> (Actually, I
> used it mostly for creating rde live cd and vm images, so didn't
> test
> much with system reconfigure or guix deploy. Also, I guess it
> would be
> cool to add a one-shot? flag to the service for skeleton like
> functionality/initial provisioning).
>
I think this activation should run only once.
>
> 3. Probably something else I already forgot.
It seems that ~/.config/guix/current is not created and
/var/guix/profiles/per-user/<user> as well.
>
> I still don't have enough spare time to clean it up, test and
> upstream,
> but if you would like to finish this thing up, I would be very
> happy to
> help!
Actually, my use case is already solved by your code and I can
build backup images of my OS.
Now I just have to figure out how to restore from backups offline.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 19 Apr 2023 11:24:20 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 24 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.