From 745ad5e88f93d0c3785f4a09859e0a8df4fddc37 Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Sat, 4 Jul 2026 23:55:20 +0800 Subject: [PATCH] services: nix-search-paths: Add nix-search-paths-activation. * modules/rosenthal/services/nix.scm (nix-search-paths-activation): New procedure. (nix-search-paths-service-type, home-nix-search-paths-service-type): Use it. --- modules/rosenthal/services/nix.scm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/rosenthal/services/nix.scm b/modules/rosenthal/services/nix.scm index 997b362..4527039 100644 --- a/modules/rosenthal/services/nix.scm +++ b/modules/rosenthal/services/nix.scm @@ -16,7 +16,13 @@ #:export (nix-search-paths-service-type home-nix-search-paths-service-type)) -(define* (nix-search-paths-shepherd-root-extension config) +(define (nix-search-paths-activation config) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p (dirname #$config))))) + +(define (nix-search-paths-shepherd-root-extension config) (list (shepherd-service (documentation "Build Nix profile and symlink it to the specified path.") @@ -28,7 +34,7 @@ (list "/run/current-system/profile/bin/build-nix-profile" #$config)))))) -(define* (nix-search-paths-home-shepherd-extension config) +(define (nix-search-paths-home-shepherd-extension config) (list (shepherd-service (documentation "Build Nix profile and symlink it to the specified path.") @@ -54,7 +60,9 @@ eval \"$(" guix "/bin/guix package --search-paths=suffix \ (service-type (name 'nix-search-paths) (extensions - (list (service-extension shepherd-root-service-type + (list (service-extension activation-service-type + nix-search-paths-activation) + (service-extension shepherd-root-service-type nix-search-paths-shepherd-root-extension) (service-extension etc-profile-d-service-type nix-search-paths-etc-profile-d-extension))) @@ -66,7 +74,9 @@ eval \"$(" guix "/bin/guix package --search-paths=suffix \ (inherit nix-search-paths-service-type) (name 'home-nix-search-paths) (extensions - (list (service-extension home-shepherd-service-type + (list (service-extension home-activation-service-type + nix-search-paths-activation) + (service-extension home-shepherd-service-type nix-search-paths-home-shepherd-extension) (service-extension home-shell-profile-service-type nix-search-paths-home-shell-profile-extension)))