unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleg Pykhalov <go.wigust@gmail.com>
To: 71320@debbugs.gnu.org
Cc: kiasoc5 <kiasoc5@disroot.org>, Oleg Pykhalov <go.wigust@gmail.com>
Subject: [bug#71320] [PATCH] services: nix: Fix activation.
Date: Sun,  2 Jun 2024 12:19:15 +0300	[thread overview]
Message-ID: <0634886cfb6a49988f427b2e0f7d10492decc931.1717319955.git.go.wigust@gmail.com> (raw)

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

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

base-commit: 6f72ad465c1e2df965e8d73b209497b4ef456527
-- 
2.41.0





             reply	other threads:[~2024-06-02  9:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-02  9:19 Oleg Pykhalov [this message]
2024-06-02 13:14 ` [bug#71320] [PATCH] services: nix: Fix activation Ludovic Courtès
2024-06-02 15:44   ` bug#71320: " Oleg Pykhalov
2024-06-02 23:03     ` [bug#71320] " kiasoc5 via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0634886cfb6a49988f427b2e0f7d10492decc931.1717319955.git.go.wigust@gmail.com \
    --to=go.wigust@gmail.com \
    --cc=71320@debbugs.gnu.org \
    --cc=kiasoc5@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).