summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2024-06-04 21:17:38 +0200
committerstuebinm2024-06-04 21:17:38 +0200
commitdaeee8711bfdb4eb635307a184d4c0c7eee61756 (patch)
tree6bcdc12eaa86af7e5cd94a658019000b007df1e8
parent7a56e1eca0dc28422bd4bd78d430bf1be2b109d4 (diff)
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.
-rwxr-xr-xpkgs/apply-config/apply-config15
1 files 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)