services: nix: Fix activation.

This commit follows 797be0ea5c.

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

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

Change-Id: I159e8af5d7bd6ce62857b356d6e9ac68fe16acf4
This commit is contained in:
Oleg Pykhalov 2024-06-02 11:01:57 +03:00
parent eac5171246
commit bc06affabc
No known key found for this signature in database
GPG key ID: 167F8EA5001AFA9C

View file

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