From 51d501a68e2f6c11460733bffb590056edbfec11 Mon Sep 17 00:00:00 2001 From: atagen Date: Thu, 10 Jul 2025 23:20:25 +1000 Subject: [PATCH] fix sudo placement, always print footer --- lib/meat.ml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/meat.ml b/lib/meat.ml index 7ef5165..04346aa 100644 --- a/lib/meat.ml +++ b/lib/meat.ml @@ -39,7 +39,10 @@ let do_build () = Unix.getenv "MEATS" ^ "#nixosConfigurations." ^ Unix.gethostname () ^ ".config.system.build.toplevel" in - do_cmd @@ "sudo nix build --profile /nix/var/nix/profiles/system --out-link " ^ tmpdir ^ "/build " ^ build_target + do_cmd @@ "nix build --out-link " ^ tmpdir ^ "/build " ^ build_target + >>= fun () -> + do_cmd @@ "sudo nix-env --set -p /nix/var/nix/profiles/system " ^ tmpdir + ^ "/build" >>= fun () -> do_cmd @@ "sudo " ^ tmpdir ^ "/build/bin/switch-to-configuration switch" >|= fun () -> Unix.unlink @@ tmpdir ^ "/build" @@ -47,10 +50,10 @@ let do_build () = let yum () = print_string header; meat_print "CONSUMING DELICIOUS MEATS.."; - do_build () |> function - | Error _ -> - print_string "FAILED TO CONSUME MEATS."; - | _ -> (); print_string footer + ( do_build () |> function + | Error _ -> print_string "FAILED TO CONSUME MEATS." + | _ -> () ); + print_string footer let cook () = print_string header;