From daeee8711bfdb4eb635307a184d4c0c7eee61756 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Tue, 4 Jun 2024 21:17:38 +0200 Subject: pkgs/apply-config: fixups the nix-env logic was still broken. It seems to have extremely weird failure modes under which it does not report errors when doing nix-env --set, or else the switch-to-configuration.pl script does not properly install the boot loader entry when it was installed via --set instead of --install. I'm not entirely clear on why yet, will need some investigating. --- pkgs/apply-config/apply-config | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/apply-config/apply-config b/pkgs/apply-config/apply-config index c827823..c411ce1 100755 --- a/pkgs/apply-config/apply-config +++ b/pkgs/apply-config/apply-config @@ -33,18 +33,19 @@ Options: ")) -(define (run-command cmd) - (when verbose - (display cmd (standard-error-port))) - (do-process! cmd)) - (define (log-msg msg) - (display msg (standard-error-port))) + (display (format "apply-config: ~a\n" msg) (standard-error-port))) (define (log-verbose msg) (when verbose (log-msg msg))) +(define (run-command cmd) + (when verbose + (log-msg (format "running ~a" cmd))) + (do-process! cmd)) + + (define (main args) (let-args (cdr args) @@ -102,7 +103,7 @@ Options: (define (install-in-env built-config) (define cmd - `(nix-env -p /nix/var/nix/profiles/system --set ,built-config)) + `(sudo nix-env -p /nix/var/nix/profiles/system --install ,built-config)) (if (or (equal? action 'switch) (equal? action 'boot)) (run-command cmd) -- cgit v1.2.3