diff mbox series

[bug#71320] services: nix: Fix activation.

Message ID 0634886cfb6a49988f427b2e0f7d10492decc931.1717319955.git.go.wigust@gmail.com
State New
Headers show
Series [bug#71320] services: nix: Fix activation. | expand

Commit Message

Oleg Pykhalov June 2, 2024, 9:19 a.m. UTC
This commit follows 797be0ea5c3703ad96acd32c98dca5f946cf5c95.

* gnu/services/nix.scm (nix-activation): Avoid provisioning the store if it
already exists.

Reported-by: kiasoc5 <kiasoc5@disroot.org>
Change-Id: I159e8af5d7bd6ce62857b356d6e9ac68fe16acf4
---
 gnu/services/nix.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)


base-commit: 6f72ad465c1e2df965e8d73b209497b4ef456527

Comments

Ludovic Courtès June 2, 2024, 1:14 p.m. UTC | #1
Hi,

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> This commit follows 797be0ea5c3703ad96acd32c98dca5f946cf5c95.
>
> * gnu/services/nix.scm (nix-activation): Avoid provisioning the store if it
> already exists.
>
> Reported-by: kiasoc5 <kiasoc5@disroot.org>
> Change-Id: I159e8af5d7bd6ce62857b356d6e9ac68fe16acf4

Please add “Fixes …” if there’s an associated bug report.

Otherwise LGTM, thanks!

Ludo’.
Oleg Pykhalov June 2, 2024, 3:44 p.m. UTC | #2
Hi Ludovic,

Thank you for the review.

Ludovic Courtès <ludo@gnu.org> writes:

> Oleg Pykhalov <go.wigust@gmail.com> skribis:
>
>> This commit follows 797be0ea5c3703ad96acd32c98dca5f946cf5c95.
>>
>> * gnu/services/nix.scm (nix-activation): Avoid provisioning the store if it
>> already exists.
>>
>> Reported-by: kiasoc5 <kiasoc5@disroot.org>
>> Change-Id: I159e8af5d7bd6ce62857b356d6e9ac68fe16acf4
>
> Please add “Fixes …” if there’s an associated bug report.
>
> Otherwise LGTM, thanks!

I've replaced 'Reported-by: kiasoc5 <kiasoc5@disroot.org>' with:

    Reported by kiasoc5 <kiasoc5@disroot.org> at
    <https://lists.gnu.org/archive/html/help-guix/2024-05/msg00185.html>.

similar to other commits.

Pushed as bc06affabcf68bbe93e9afee13bef8cc8c6336a2 to master.


Regards,
Oleg.
kiasoc5 June 2, 2024, 11:03 p.m. UTC | #3
On 6/2/24 11:44, Oleg Pykhalov wrote:
> Hi Ludovic,
> 
> Thank you for the review.
> 
> Ludovic Courtès <ludo@gnu.org> writes:
> 
>> Oleg Pykhalov <go.wigust@gmail.com> skribis:
>>
>>> This commit follows 797be0ea5c3703ad96acd32c98dca5f946cf5c95.
>>>
>>> * gnu/services/nix.scm (nix-activation): Avoid provisioning the store if it
>>> already exists.
>>>
>>> Reported-by: kiasoc5 <kiasoc5@disroot.org>
>>> Change-Id: I159e8af5d7bd6ce62857b356d6e9ac68fe16acf4
>>
>> Please add “Fixes …” if there’s an associated bug report.
>>
>> Otherwise LGTM, thanks!
> 
> I've replaced 'Reported-by: kiasoc5 <kiasoc5@disroot.org>' with:
> 
>      Reported by kiasoc5 <kiasoc5@disroot.org> at
>      <https://lists.gnu.org/archive/html/help-guix/2024-05/msg00185.html>.
> 
> similar to other commits.
> 
> Pushed as bc06affabcf68bbe93e9afee13bef8cc8c6336a2 to master.
> 
> 
> Regards,
> Oleg.

Thanks! I'll report bugs to bug-guix next time.
diff mbox series

Patch

diff --git a/gnu/services/nix.scm b/gnu/services/nix.scm
index 419e5968fe..9749fc9e0f 100644
--- a/gnu/services/nix.scm
+++ b/gnu/services/nix.scm
@@ -98,12 +98,14 @@  (define (nix-activation _)
   #~(begin
       (use-modules (guix build utils)
                    (srfi srfi-26))
-      (for-each (cut mkdir-p <>) '("/nix/store" "/nix/var/log"
+      (for-each (cut mkdir-p <>) '("/nix/var/log"
                                    "/nix/var/nix/gcroots/per-user"
                                    "/nix/var/nix/profiles/per-user"))
-      (chown "/nix/store"
-             (passwd:uid (getpw "root")) (group:gid (getpw "nixbld01")))
-      (chmod "/nix/store" #o775)
+      (unless (file-exists? #$%nix-store-directory)
+        (mkdir-p #$%nix-store-directory)
+        (chown #$%nix-store-directory
+               (passwd:uid (getpw "root")) (group:gid (getpw "nixbld01")))
+        (chmod #$%nix-store-directory #o775))
       (for-each (cut chmod <> #o777) '("/nix/var/nix/profiles"
                                        "/nix/var/nix/profiles/per-user"))))