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;