diff --git a/pkgs/tools/virtualization/multipass/cmake_no_fetch.patch b/pkgs/by-name/mu/multipass/cmake_no_fetch.patch similarity index 100% rename from pkgs/tools/virtualization/multipass/cmake_no_fetch.patch rename to pkgs/by-name/mu/multipass/cmake_no_fetch.patch diff --git a/pkgs/tools/virtualization/multipass/cmake_warning.patch b/pkgs/by-name/mu/multipass/cmake_warning.patch similarity index 100% rename from pkgs/tools/virtualization/multipass/cmake_warning.patch rename to pkgs/by-name/mu/multipass/cmake_warning.patch diff --git a/pkgs/by-name/mu/multipass/gui.nix b/pkgs/by-name/mu/multipass/gui.nix new file mode 100644 index 0000000000000..eee18a35896af --- /dev/null +++ b/pkgs/by-name/mu/multipass/gui.nix @@ -0,0 +1,79 @@ +{ + commonMeta, + multipass_src, + multipassd, + version, + + autoPatchelfHook, + flutter327, + gtkmm3, + keybinder3, + lib, + libayatana-appindicator, + libnotify, + protobuf, + protoc-gen-dart, + qt6, +}: +flutter327.buildFlutterApplication { + inherit version; + pname = "multipass-gui"; + src = multipass_src; + + sourceRoot = "${multipass_src.name}/src/client/gui"; + + pubspecLock = lib.importJSON ./pubspec.lock.json; + + gitHashes = { + dartssh2 = "sha256-2pypKwurziwGLZYuGaxlS2lzN3UvJp3bRTvvYYxEqRI="; + hotkey_manager_linux = "sha256-aO0h94YZvgV/ggVupNw8GjyZsnXrq3qTHRDtuhNv3oI="; + system_info2 = "sha256-fly7E2vG+bQ/+QGzXk+DYba73RZccltdW2LpZGDKX60="; + tray_menu = "sha256-riiAiBEms+9ARog8i+MR1fto1Yqx+gwbBWyNbNq6VTM="; + window_size = "sha256-71PqQzf+qY23hTJvcm0Oye8tng3Asr42E2vfF1nBmVA="; + xterm = "sha256-h8vIonTPUVnNqZPk/A4ZV7EYCMyM0rrErL9ZOMe4ZBE="; + }; + + buildInputs = [ + gtkmm3 + keybinder3 + libayatana-appindicator + libnotify + qt6.qtbase + qt6.qtwayland + ]; + + nativeBuildInputs = [ + autoPatchelfHook + protobuf + protoc-gen-dart + qt6.wrapQtAppsHook + ]; + + preBuild = '' + mkdir -p lib/generated + + # Generate the Dart gRPC code for the Multipass GUI. + protoc \ + --plugin=protoc-gen-dart=${lib.getExe protoc-gen-dart} \ + --dart_out=grpc:lib/generated \ + -I ../../rpc \ + ../../rpc/multipass.proto \ + google/protobuf/timestamp.proto + ''; + + runtimeDependencies = [ multipassd ]; + + postFixup = '' + mv $out/bin/multipass_gui $out/bin/multipass.gui + + install -Dm444 $out/app/multipass-gui/data/flutter_assets/assets/icon.png \ + $out/share/icons/hicolor/256x256/apps/multipass.gui.png + + cp $out/share/applications/multipass.gui.autostart.desktop \ + $out/share/applications/multipass.gui.desktop + ''; + + meta = commonMeta // { + description = "Flutter frontend application for managing Ubuntu VMs"; + }; +} diff --git a/pkgs/tools/virtualization/multipass/lxd_socket_path.patch b/pkgs/by-name/mu/multipass/lxd_socket_path.patch similarity index 100% rename from pkgs/tools/virtualization/multipass/lxd_socket_path.patch rename to pkgs/by-name/mu/multipass/lxd_socket_path.patch diff --git a/pkgs/tools/virtualization/multipass/default.nix b/pkgs/by-name/mu/multipass/multipassd.nix similarity index 81% rename from pkgs/tools/virtualization/multipass/default.nix rename to pkgs/by-name/mu/multipass/multipassd.nix index 2392246001591..2cc6f9b6fb06c 100644 --- a/pkgs/tools/virtualization/multipass/default.nix +++ b/pkgs/by-name/mu/multipass/multipassd.nix @@ -1,4 +1,8 @@ { + commonMeta, + multipass_src, + version, + cmake, dnsmasq, fetchFromGitHub, @@ -10,53 +14,35 @@ libapparmor, libvirt, libxml2, - nixosTests, openssl, OVMF, pkg-config, - qemu, poco, protobuf, qemu-utils, - qtbase, - qtwayland, - wrapQtAppsHook, + qemu, + qt6, slang, stdenv, xterm, }: let - pname = "multipass"; - version = "1.14.1"; - # This is done here because a CMakeLists.txt from one of it's submodules tries # to modify a file, so we grab the source for the submodule here, copy it into # the source of the Multipass project which allows the modification to happen. grpc_src = fetchFromGitHub { - owner = "CanonicalLtd"; + owner = "canonical"; repo = "grpc"; - rev = "e3acf245"; - hash = "sha256-tDc2iGxIV68Yi4RL8ES4yglJNlu8yH6FlpVvZoWjoXk="; + rev = "ba8e7f72a57b9e0b25783a4d3cea58c79379f194"; + hash = "sha256-DS1UNLCUdbipn5w4p2aVa8LgHHhdJiAfzfEdIXNO69o="; fetchSubmodules = true; }; in stdenv.mkDerivation { - inherit pname version; - - src = fetchFromGitHub { - owner = "canonical"; - repo = "multipass"; - rev = "refs/tags/v${version}"; - hash = "sha256-i6SKiV4jwiBURx85m3u7km1dhi+fRdVpMBanlZo0VK4="; - fetchSubmodules = true; - leaveDotGit = true; - postFetch = '' - # Workaround for https://github.com/NixOS/nixpkgs/issues/8567 - cd $out - rm -rf .git - ''; - }; + inherit version; + pname = "multipassd"; + src = multipass_src; patches = [ # Multipass is usually only delivered as a snap package on Linux, and it expects that @@ -86,6 +72,9 @@ stdenv.mkDerivation { --replace-fail "determine_version(MULTIPASS_VERSION)" "" \ --replace-fail 'set(MULTIPASS_VERSION ''${MULTIPASS_VERSION})' 'set(MULTIPASS_VERSION "v${version}")' + # Don't build the GUI .desktop file, do that in the gui derivation instead + substituteInPlace ./CMakeLists.txt --replace-fail "add_subdirectory(data)" "" + # Don't build/use vcpkg rm -rf 3rd-party/vcpkg @@ -118,7 +107,7 @@ stdenv.mkDerivation { EOF ''; - # We'll build the flutter application seperately using buildFlutterApplication + # We'll build the flutter application separately using buildFlutterApplication cmakeFlags = [ "-DMULTIPASS_ENABLE_FLUTTER_GUI=false" ]; buildInputs = [ @@ -127,18 +116,18 @@ stdenv.mkDerivation { libvirt libxml2 openssl - qtbase - qtwayland poco.dev protobuf + qt6.qtbase + qt6.qtwayland ]; nativeBuildInputs = [ cmake git pkg-config + qt6.wrapQtAppsHook slang - wrapQtAppsHook ]; nativeCheckInputs = [ gtest ]; @@ -157,15 +146,7 @@ stdenv.mkDerivation { } ''; - passthru.tests = { - multipass = nixosTests.multipass; - }; - - meta = with lib; { - description = "Ubuntu VMs on demand for any workstation"; - homepage = "https://multipass.run"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ jnsgruk ]; - platforms = [ "x86_64-linux" ]; + meta = commonMeta // { + description = "Backend server & client for managing on-demand Ubuntu VMs"; }; } diff --git a/pkgs/by-name/mu/multipass/package.nix b/pkgs/by-name/mu/multipass/package.nix new file mode 100644 index 0000000000000..788eb4e9eec5d --- /dev/null +++ b/pkgs/by-name/mu/multipass/package.nix @@ -0,0 +1,61 @@ +{ + callPackage, + fetchFromGitHub, + lib, + nixosTests, + stdenv, + symlinkJoin, +}: + +let + name = "multipass"; + version = "1.15.0"; + + multipass_src = fetchFromGitHub { + owner = "canonical"; + repo = "multipass"; + rev = "refs/tags/v${version}"; + hash = "sha256-RoOCh1winDs7BZwyduZziHj6EMe3sGMYonkA757UrIU="; + fetchSubmodules = true; + }; + + commonMeta = { + homepage = "https://multipass.run"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ jnsgruk ]; + platforms = [ "x86_64-linux" ]; + }; + + multipassd = callPackage ./multipassd.nix { + inherit commonMeta multipass_src version; + }; + + multipass-gui = callPackage ./gui.nix { + inherit + commonMeta + multipass_src + multipassd + version + ; + }; +in +symlinkJoin { + inherit version; + pname = name; + + paths = [ + multipassd + multipass-gui + ]; + + passthru = { + tests = lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit (nixosTests) multipass; + }; + updateScript = ./update.sh; + }; + + meta = commonMeta // { + description = "Ubuntu VMs on demand for any workstation"; + }; +} diff --git a/pkgs/by-name/mu/multipass/pubspec.lock.json b/pkgs/by-name/mu/multipass/pubspec.lock.json new file mode 100644 index 0000000000000..b9a582979b709 --- /dev/null +++ b/pkgs/by-name/mu/multipass/pubspec.lock.json @@ -0,0 +1 @@ +{"packages":{"args":{"dependency":"transitive","description":{"name":"args","sha256":"7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a","url":"https://pub.dev"},"source":"hosted","version":"2.5.0"},"asn1lib":{"dependency":"transitive","description":{"name":"asn1lib","sha256":"6b151826fcc95ff246cd219a0bf4c753ea14f4081ad71c61939becf3aba27f70","url":"https://pub.dev"},"source":"hosted","version":"1.5.5"},"async":{"dependency":"direct main","description":{"name":"async","sha256":"947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c","url":"https://pub.dev"},"source":"hosted","version":"2.11.0"},"basics":{"dependency":"direct main","description":{"name":"basics","sha256":"41ff8aded84ae174d1df5cce0bcac3ab9070caac9f7da35fd2cc638dfee6163f","url":"https://pub.dev"},"source":"hosted","version":"0.10.0"},"boolean_selector":{"dependency":"transitive","description":{"name":"boolean_selector","sha256":"6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66","url":"https://pub.dev"},"source":"hosted","version":"2.1.1"},"built_collection":{"dependency":"direct main","description":{"name":"built_collection","sha256":"376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100","url":"https://pub.dev"},"source":"hosted","version":"5.1.1"},"characters":{"dependency":"transitive","description":{"name":"characters","sha256":"04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605","url":"https://pub.dev"},"source":"hosted","version":"1.3.0"},"clock":{"dependency":"transitive","description":{"name":"clock","sha256":"cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf","url":"https://pub.dev"},"source":"hosted","version":"1.1.1"},"collection":{"dependency":"direct main","description":{"name":"collection","sha256":"ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a","url":"https://pub.dev"},"source":"hosted","version":"1.18.0"},"convert":{"dependency":"transitive","description":{"name":"convert","sha256":"0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592","url":"https://pub.dev"},"source":"hosted","version":"3.1.1"},"cross_file":{"dependency":"transitive","description":{"name":"cross_file","sha256":"7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670","url":"https://pub.dev"},"source":"hosted","version":"0.3.4+2"},"crypto":{"dependency":"transitive","description":{"name":"crypto","sha256":"ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27","url":"https://pub.dev"},"source":"hosted","version":"3.0.5"},"dartssh2":{"dependency":"direct main","description":{"path":".","ref":"2.10.0+mp","resolved-ref":"e7c66932cf7ca8eba083268fa3230222c8cd0722","url":"https://github.com/andrei-toterman/dartssh2.git"},"source":"git","version":"2.10.0"},"equatable":{"dependency":"transitive","description":{"name":"equatable","sha256":"c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2","url":"https://pub.dev"},"source":"hosted","version":"2.0.5"},"extended_text":{"dependency":"direct main","description":{"name":"extended_text","sha256":"b0cdd240b4ddf61d18d7e33e7775195971f2d033bd69706fa897446dc96c3b81","url":"https://pub.dev"},"source":"hosted","version":"14.1.0"},"extended_text_library":{"dependency":"transitive","description":{"name":"extended_text_library","sha256":"55d09098ec56fab0d9a8a68950ca0bbf2efa1327937f7cec6af6dfa066234829","url":"https://pub.dev"},"source":"hosted","version":"12.0.0"},"ffi":{"dependency":"direct main","description":{"name":"ffi","sha256":"16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6","url":"https://pub.dev"},"source":"hosted","version":"2.1.3"},"file":{"dependency":"transitive","description":{"name":"file","sha256":"5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c","url":"https://pub.dev"},"source":"hosted","version":"7.0.0"},"file_selector":{"dependency":"direct main","description":{"name":"file_selector","sha256":"5019692b593455127794d5718304ff1ae15447dea286cdda9f0db2a796a1b828","url":"https://pub.dev"},"source":"hosted","version":"1.0.3"},"file_selector_android":{"dependency":"transitive","description":{"name":"file_selector_android","sha256":"8bcc3af859e9d47fab9c7dc315537406511a894ab578e198bd8f9ed745ea5a01","url":"https://pub.dev"},"source":"hosted","version":"0.5.1+2"},"file_selector_ios":{"dependency":"transitive","description":{"name":"file_selector_ios","sha256":"38ebf91ecbcfa89a9639a0854ccaed8ab370c75678938eebca7d34184296f0bb","url":"https://pub.dev"},"source":"hosted","version":"0.5.3"},"file_selector_linux":{"dependency":"transitive","description":{"name":"file_selector_linux","sha256":"045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492","url":"https://pub.dev"},"source":"hosted","version":"0.9.2+1"},"file_selector_macos":{"dependency":"transitive","description":{"name":"file_selector_macos","sha256":"f42eacb83b318e183b1ae24eead1373ab1334084404c8c16e0354f9a3e55d385","url":"https://pub.dev"},"source":"hosted","version":"0.9.4"},"file_selector_platform_interface":{"dependency":"transitive","description":{"name":"file_selector_platform_interface","sha256":"a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b","url":"https://pub.dev"},"source":"hosted","version":"2.6.2"},"file_selector_web":{"dependency":"transitive","description":{"name":"file_selector_web","sha256":"c4c0ea4224d97a60a7067eca0c8fd419e708ff830e0c83b11a48faf566cec3e7","url":"https://pub.dev"},"source":"hosted","version":"0.9.4+2"},"file_selector_windows":{"dependency":"transitive","description":{"name":"file_selector_windows","sha256":"2ad726953f6e8affbc4df8dc78b77c3b4a060967a291e528ef72ae846c60fb69","url":"https://pub.dev"},"source":"hosted","version":"0.9.3+2"},"fixnum":{"dependency":"transitive","description":{"name":"fixnum","sha256":"25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1","url":"https://pub.dev"},"source":"hosted","version":"1.1.0"},"fl_chart":{"dependency":"direct main","description":{"name":"fl_chart","sha256":"94307bef3a324a0d329d3ab77b2f0c6e5ed739185ffc029ed28c0f9b019ea7ef","url":"https://pub.dev"},"source":"hosted","version":"0.69.0"},"flutter":{"dependency":"direct main","description":"flutter","source":"sdk","version":"0.0.0"},"flutter_lints":{"dependency":"direct dev","description":{"name":"flutter_lints","sha256":"5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1","url":"https://pub.dev"},"source":"hosted","version":"5.0.0"},"flutter_riverpod":{"dependency":"direct main","description":{"name":"flutter_riverpod","sha256":"0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d","url":"https://pub.dev"},"source":"hosted","version":"2.5.1"},"flutter_svg":{"dependency":"direct main","description":{"name":"flutter_svg","sha256":"7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2","url":"https://pub.dev"},"source":"hosted","version":"2.0.10+1"},"flutter_web_plugins":{"dependency":"transitive","description":"flutter","source":"sdk","version":"0.0.0"},"fpdart":{"dependency":"direct main","description":{"name":"fpdart","sha256":"7413acc5a6569a3fe8277928fc7487f3198530f0c4e635d0baef199ea36e8ee9","url":"https://pub.dev"},"source":"hosted","version":"1.1.0"},"globbing":{"dependency":"transitive","description":{"name":"globbing","sha256":"4f89cfaf6fa74c9c1740a96259da06bd45411ede56744e28017cc534a12b6e2d","url":"https://pub.dev"},"source":"hosted","version":"1.0.0"},"google_identity_services_web":{"dependency":"transitive","description":{"name":"google_identity_services_web","sha256":"5be191523702ba8d7a01ca97c17fca096822ccf246b0a9f11923a6ded06199b6","url":"https://pub.dev"},"source":"hosted","version":"0.3.1+4"},"googleapis_auth":{"dependency":"transitive","description":{"name":"googleapis_auth","sha256":"befd71383a955535060acde8792e7efc11d2fccd03dd1d3ec434e85b68775938","url":"https://pub.dev"},"source":"hosted","version":"1.6.0"},"grpc":{"dependency":"direct main","description":{"name":"grpc","sha256":"5b99b7a420937d4361ece68b798c9af8e04b5bc128a7859f2a4be87427694813","url":"https://pub.dev"},"source":"hosted","version":"4.0.1"},"hotkey_manager":{"dependency":"direct main","description":{"name":"hotkey_manager","sha256":"06f0655b76c8dd322fb7101dc615afbdbf39c3d3414df9e059c33892104479cd","url":"https://pub.dev"},"source":"hosted","version":"0.2.3"},"hotkey_manager_linux":{"dependency":"direct overridden","description":{"path":"packages/hotkey_manager_linux","ref":"no-cooked-accel","resolved-ref":"7e5a662615fbc9f077c1567fd7a66ec34ad52b5e","url":"https://github.com/andrei-toterman/hotkey_manager.git"},"source":"git","version":"0.2.0"},"hotkey_manager_macos":{"dependency":"transitive","description":{"name":"hotkey_manager_macos","sha256":"03b5967e64357b9ac05188ea4a5df6fe4ed4205762cb80aaccf8916ee1713c96","url":"https://pub.dev"},"source":"hosted","version":"0.2.0"},"hotkey_manager_platform_interface":{"dependency":"transitive","description":{"name":"hotkey_manager_platform_interface","sha256":"98ffca25b8cc9081552902747b2942e3bc37855389a4218c9d50ca316b653b13","url":"https://pub.dev"},"source":"hosted","version":"0.2.0"},"hotkey_manager_windows":{"dependency":"transitive","description":{"name":"hotkey_manager_windows","sha256":"0d03ced9fe563ed0b68f0a0e1b22c9ffe26eb8053cb960e401f68a4f070e0117","url":"https://pub.dev"},"source":"hosted","version":"0.2.0"},"http":{"dependency":"transitive","description":{"name":"http","sha256":"b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010","url":"https://pub.dev"},"source":"hosted","version":"1.2.2"},"http2":{"dependency":"transitive","description":{"name":"http2","sha256":"9ced024a160b77aba8fb8674e38f70875e321d319e6f303ec18e87bd5a4b0c1d","url":"https://pub.dev"},"source":"hosted","version":"2.3.0"},"http_parser":{"dependency":"transitive","description":{"name":"http_parser","sha256":"2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b","url":"https://pub.dev"},"source":"hosted","version":"4.0.2"},"intl":{"dependency":"direct main","description":{"name":"intl","sha256":"99f282cb0e02edcbbf8c6b3bbc7c90b65635156c412e58f3975a7e55284ce685","url":"https://pub.dev"},"source":"hosted","version":"0.20.0"},"js":{"dependency":"transitive","description":{"name":"js","sha256":"c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf","url":"https://pub.dev"},"source":"hosted","version":"0.7.1"},"json_annotation":{"dependency":"transitive","description":{"name":"json_annotation","sha256":"1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1","url":"https://pub.dev"},"source":"hosted","version":"4.9.0"},"lints":{"dependency":"transitive","description":{"name":"lints","sha256":"3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413","url":"https://pub.dev"},"source":"hosted","version":"5.0.0"},"local_notifier":{"dependency":"direct main","description":{"name":"local_notifier","sha256":"f6cfc933c6fbc961f4e52b5c880f68e41b2d3cd29aad557cc654fd211093a025","url":"https://pub.dev"},"source":"hosted","version":"0.1.6"},"logger":{"dependency":"direct main","description":{"name":"logger","sha256":"697d067c60c20999686a0add96cf6aba723b3aa1f83ecf806a8097231529ec32","url":"https://pub.dev"},"source":"hosted","version":"2.4.0"},"matcher":{"dependency":"transitive","description":{"name":"matcher","sha256":"d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb","url":"https://pub.dev"},"source":"hosted","version":"0.12.16+1"},"material_color_utilities":{"dependency":"transitive","description":{"name":"material_color_utilities","sha256":"f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec","url":"https://pub.dev"},"source":"hosted","version":"0.11.1"},"meta":{"dependency":"transitive","description":{"name":"meta","sha256":"bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7","url":"https://pub.dev"},"source":"hosted","version":"1.15.0"},"path":{"dependency":"transitive","description":{"name":"path","sha256":"087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af","url":"https://pub.dev"},"source":"hosted","version":"1.9.0"},"path_parsing":{"dependency":"transitive","description":{"name":"path_parsing","sha256":"e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf","url":"https://pub.dev"},"source":"hosted","version":"1.0.1"},"path_provider":{"dependency":"direct main","description":{"name":"path_provider","sha256":"fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378","url":"https://pub.dev"},"source":"hosted","version":"2.1.4"},"path_provider_android":{"dependency":"transitive","description":{"name":"path_provider_android","sha256":"6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7","url":"https://pub.dev"},"source":"hosted","version":"2.2.10"},"path_provider_foundation":{"dependency":"transitive","description":{"name":"path_provider_foundation","sha256":"f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16","url":"https://pub.dev"},"source":"hosted","version":"2.4.0"},"path_provider_linux":{"dependency":"transitive","description":{"name":"path_provider_linux","sha256":"f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279","url":"https://pub.dev"},"source":"hosted","version":"2.2.1"},"path_provider_platform_interface":{"dependency":"transitive","description":{"name":"path_provider_platform_interface","sha256":"88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334","url":"https://pub.dev"},"source":"hosted","version":"2.1.2"},"path_provider_windows":{"dependency":"transitive","description":{"name":"path_provider_windows","sha256":"bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7","url":"https://pub.dev"},"source":"hosted","version":"2.3.0"},"petitparser":{"dependency":"transitive","description":{"name":"petitparser","sha256":"c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27","url":"https://pub.dev"},"source":"hosted","version":"6.0.2"},"pinenacl":{"dependency":"transitive","description":{"name":"pinenacl","sha256":"57e907beaacbc3c024a098910b6240758e899674de07d6949a67b52fd984cbdf","url":"https://pub.dev"},"source":"hosted","version":"0.6.0"},"platform":{"dependency":"transitive","description":{"name":"platform","sha256":"9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65","url":"https://pub.dev"},"source":"hosted","version":"3.1.5"},"plugin_platform_interface":{"dependency":"transitive","description":{"name":"plugin_platform_interface","sha256":"4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02","url":"https://pub.dev"},"source":"hosted","version":"2.1.8"},"pointycastle":{"dependency":"transitive","description":{"name":"pointycastle","sha256":"4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe","url":"https://pub.dev"},"source":"hosted","version":"3.9.1"},"protobuf":{"dependency":"direct main","description":{"name":"protobuf","sha256":"68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d","url":"https://pub.dev"},"source":"hosted","version":"3.1.0"},"quiver":{"dependency":"transitive","description":{"name":"quiver","sha256":"ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2","url":"https://pub.dev"},"source":"hosted","version":"3.2.2"},"riverpod":{"dependency":"transitive","description":{"name":"riverpod","sha256":"f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d","url":"https://pub.dev"},"source":"hosted","version":"2.5.1"},"rxdart":{"dependency":"direct main","description":{"name":"rxdart","sha256":"5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962","url":"https://pub.dev"},"source":"hosted","version":"0.28.0"},"screen_retriever":{"dependency":"transitive","description":{"name":"screen_retriever","sha256":"6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90","url":"https://pub.dev"},"source":"hosted","version":"0.1.9"},"shared_preferences":{"dependency":"direct main","description":{"name":"shared_preferences","sha256":"746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051","url":"https://pub.dev"},"source":"hosted","version":"2.3.2"},"shared_preferences_android":{"dependency":"transitive","description":{"name":"shared_preferences_android","sha256":"480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e","url":"https://pub.dev"},"source":"hosted","version":"2.3.2"},"shared_preferences_foundation":{"dependency":"transitive","description":{"name":"shared_preferences_foundation","sha256":"c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f","url":"https://pub.dev"},"source":"hosted","version":"2.5.2"},"shared_preferences_linux":{"dependency":"transitive","description":{"name":"shared_preferences_linux","sha256":"580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f","url":"https://pub.dev"},"source":"hosted","version":"2.4.1"},"shared_preferences_platform_interface":{"dependency":"transitive","description":{"name":"shared_preferences_platform_interface","sha256":"57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80","url":"https://pub.dev"},"source":"hosted","version":"2.4.1"},"shared_preferences_web":{"dependency":"transitive","description":{"name":"shared_preferences_web","sha256":"d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e","url":"https://pub.dev"},"source":"hosted","version":"2.4.2"},"shared_preferences_windows":{"dependency":"transitive","description":{"name":"shared_preferences_windows","sha256":"94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1","url":"https://pub.dev"},"source":"hosted","version":"2.4.1"},"sky_engine":{"dependency":"transitive","description":"flutter","source":"sdk","version":"0.0.99"},"source_span":{"dependency":"transitive","description":{"name":"source_span","sha256":"53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c","url":"https://pub.dev"},"source":"hosted","version":"1.10.0"},"sprintf":{"dependency":"transitive","description":{"name":"sprintf","sha256":"1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23","url":"https://pub.dev"},"source":"hosted","version":"7.0.0"},"stack_trace":{"dependency":"transitive","description":{"name":"stack_trace","sha256":"9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377","url":"https://pub.dev"},"source":"hosted","version":"1.12.0"},"state_notifier":{"dependency":"transitive","description":{"name":"state_notifier","sha256":"b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb","url":"https://pub.dev"},"source":"hosted","version":"1.0.0"},"stream_channel":{"dependency":"transitive","description":{"name":"stream_channel","sha256":"ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7","url":"https://pub.dev"},"source":"hosted","version":"2.1.2"},"string_scanner":{"dependency":"transitive","description":{"name":"string_scanner","sha256":"688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3","url":"https://pub.dev"},"source":"hosted","version":"1.3.0"},"synchronized":{"dependency":"direct main","description":{"name":"synchronized","sha256":"69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225","url":"https://pub.dev"},"source":"hosted","version":"3.3.0+3"},"system_info2":{"dependency":"direct main","description":{"path":".","ref":"4.0.0+mp","resolved-ref":"ea5fac0e3a03db72276d946f6ca9abc9939e737a","url":"https://github.com/andrei-toterman/system_info.git"},"source":"git","version":"4.0.0"},"term_glyph":{"dependency":"transitive","description":{"name":"term_glyph","sha256":"a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84","url":"https://pub.dev"},"source":"hosted","version":"1.2.1"},"test_api":{"dependency":"transitive","description":{"name":"test_api","sha256":"664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c","url":"https://pub.dev"},"source":"hosted","version":"0.7.3"},"tray_menu":{"dependency":"direct main","description":{"path":".","ref":"7c1394c","resolved-ref":"7c1394c46aac4598ebdd3fa6670e4ea2904a4d31","url":"https://github.com/andrei-toterman/tray_menu.git"},"source":"git","version":"0.0.1"},"two_dimensional_scrollables":{"dependency":"direct main","description":{"name":"two_dimensional_scrollables","sha256":"74ce1f35a8c74370b322049c9d00bf098938661e9f67054eae0f618e6dc0cb62","url":"https://pub.dev"},"source":"hosted","version":"0.3.2"},"typed_data":{"dependency":"transitive","description":{"name":"typed_data","sha256":"facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c","url":"https://pub.dev"},"source":"hosted","version":"1.3.2"},"uni_platform":{"dependency":"transitive","description":{"name":"uni_platform","sha256":"e02213a7ee5352212412ca026afd41d269eb00d982faa552f419ffc2debfad84","url":"https://pub.dev"},"source":"hosted","version":"0.1.3"},"url_launcher":{"dependency":"direct main","description":{"name":"url_launcher","sha256":"21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3","url":"https://pub.dev"},"source":"hosted","version":"6.3.0"},"url_launcher_android":{"dependency":"transitive","description":{"name":"url_launcher_android","sha256":"e35a698ac302dd68e41f73250bd9517fe3ab5fa4f18fe4647a0872db61bacbab","url":"https://pub.dev"},"source":"hosted","version":"6.3.10"},"url_launcher_ios":{"dependency":"transitive","description":{"name":"url_launcher_ios","sha256":"e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e","url":"https://pub.dev"},"source":"hosted","version":"6.3.1"},"url_launcher_linux":{"dependency":"transitive","description":{"name":"url_launcher_linux","sha256":"e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af","url":"https://pub.dev"},"source":"hosted","version":"3.2.0"},"url_launcher_macos":{"dependency":"transitive","description":{"name":"url_launcher_macos","sha256":"769549c999acdb42b8bcfa7c43d72bf79a382ca7441ab18a808e101149daf672","url":"https://pub.dev"},"source":"hosted","version":"3.2.1"},"url_launcher_platform_interface":{"dependency":"transitive","description":{"name":"url_launcher_platform_interface","sha256":"552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029","url":"https://pub.dev"},"source":"hosted","version":"2.3.2"},"url_launcher_web":{"dependency":"transitive","description":{"name":"url_launcher_web","sha256":"772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e","url":"https://pub.dev"},"source":"hosted","version":"2.3.3"},"url_launcher_windows":{"dependency":"transitive","description":{"name":"url_launcher_windows","sha256":"49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185","url":"https://pub.dev"},"source":"hosted","version":"3.1.2"},"uuid":{"dependency":"transitive","description":{"name":"uuid","sha256":"a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff","url":"https://pub.dev"},"source":"hosted","version":"4.5.1"},"vector_graphics":{"dependency":"transitive","description":{"name":"vector_graphics","sha256":"32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3","url":"https://pub.dev"},"source":"hosted","version":"1.1.11+1"},"vector_graphics_codec":{"dependency":"transitive","description":{"name":"vector_graphics_codec","sha256":"c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da","url":"https://pub.dev"},"source":"hosted","version":"1.1.11+1"},"vector_graphics_compiler":{"dependency":"transitive","description":{"name":"vector_graphics_compiler","sha256":"12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81","url":"https://pub.dev"},"source":"hosted","version":"1.1.11+1"},"vector_math":{"dependency":"transitive","description":{"name":"vector_math","sha256":"80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803","url":"https://pub.dev"},"source":"hosted","version":"2.1.4"},"web":{"dependency":"transitive","description":{"name":"web","sha256":"97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27","url":"https://pub.dev"},"source":"hosted","version":"0.5.1"},"win32":{"dependency":"direct main","description":{"name":"win32","sha256":"4d45dc9069dba4619dc0ebd93c7cec5e66d8482cb625a370ac806dcc8165f2ec","url":"https://pub.dev"},"source":"hosted","version":"5.5.5"},"window_manager":{"dependency":"direct main","description":{"name":"window_manager","sha256":"ab8b2a7f97543d3db2b506c9d875e637149d48ee0c6a5cb5f5fd6e0dac463792","url":"https://pub.dev"},"source":"hosted","version":"0.4.2"},"window_size":{"dependency":"direct main","description":{"path":"plugins/window_size","ref":"6c66ad2","resolved-ref":"6c66ad23ee79749f30a8eece542cf54eaf157ed8","url":"https://github.com/google/flutter-desktop-embedding.git"},"source":"git","version":"0.1.0"},"xdg_directories":{"dependency":"transitive","description":{"name":"xdg_directories","sha256":"faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d","url":"https://pub.dev"},"source":"hosted","version":"1.0.4"},"xml":{"dependency":"transitive","description":{"name":"xml","sha256":"b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226","url":"https://pub.dev"},"source":"hosted","version":"6.5.0"},"xterm":{"dependency":"direct main","description":{"path":".","ref":"4.0.0+mp","resolved-ref":"ff2309c1581c025ba8b9f65e6619fe2fe2252827","url":"https://github.com/levkropp/xterm.dart"},"source":"git","version":"4.0.0"},"zmodem":{"dependency":"transitive","description":{"name":"zmodem","sha256":"3b7e5b29f3a7d8aee472029b05165a68438eff2f3f7766edf13daba1e297adbf","url":"https://pub.dev"},"source":"hosted","version":"0.0.6"}},"sdks":{"dart":">=3.5.0 <4.0.0","flutter":">=3.24.0"}} diff --git a/pkgs/tools/virtualization/multipass/test_unreachable_call.patch b/pkgs/by-name/mu/multipass/test_unreachable_call.patch similarity index 100% rename from pkgs/tools/virtualization/multipass/test_unreachable_call.patch rename to pkgs/by-name/mu/multipass/test_unreachable_call.patch diff --git a/pkgs/by-name/mu/multipass/update.sh b/pkgs/by-name/mu/multipass/update.sh new file mode 100755 index 0000000000000..c50f482901812 --- /dev/null +++ b/pkgs/by-name/mu/multipass/update.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env nix-shell +#!nix-shell -I nixpkgs=./. -i bash -p curl jq nix-prefetch-github yj git +# shellcheck shell=bash + +set -euo pipefail + +cd $(readlink -e $(dirname "${BASH_SOURCE[0]}")) + +# Download the latest pubspec.lock (which is a YAML file), convert it to JSON and write it to +# the package directory as pubspec.lock.json +update_pubspec_json() { + local version; version="$1" + echo "Updating pubspec.lock.json" + + curl -s \ + "https://raw.githubusercontent.com/canonical/multipass/refs/tags/v${version}/src/client/gui/pubspec.lock" \ + | yj > pubspec.lock.json +} + +# Update the SRI hash of a particular overridden Dart package in the Nix expression +update_dart_pkg_hash() { + local pkg_name; pkg_name="$1" + local owner; owner="$2"; + local repo; repo="$3"; + echo "Updating dart package hash: $pkg_name" + + resolved_ref="$(jq -r --arg PKG "$pkg_name" '.packages[$PKG].description."resolved-ref"' pubspec.lock.json)" + hash="$(nix-prefetch-github --rev "$resolved_ref" "$owner" "$repo" | jq '.hash')" + sed -i "s|${pkg_name} = \".*\";|${pkg_name} = $hash;|" gui.nix +} + +# Update the hash of the multipass source code in the Nix expression. +update_multipass_source() { + local version; version="$1" + echo "Updating multipass source" + + sri_hash="$(nix-prefetch-github canonical multipass --rev "refs/tags/v${version}" --fetch-submodules | jq -r '.hash')" + + sed -i "s|version = \".*$|version = \"$version\";|" package.nix + sed -i "s|hash = \".*$|hash = \"${sri_hash}\";|" package.nix +} + +# Update the version/hash of the grpc source code in the Nix expression. +update_grpc_source() { + local version; version="$1" + echo "Updating grpc source" + + submodule_info="https://raw.githubusercontent.com/canonical/multipass/refs/tags/v${version}/3rd-party/submodule_info.md" + commit_short="$(curl -s "${submodule_info}" | grep -Po "CanonicalLtd/grpc/compare/v[0-9]+\.[0-9]+\.[0-9]+\.\.\K[0-9a-f]+")" + commit_hash="$(curl -s "https://github.com/canonical/grpc/commits/${commit_short}" | grep -Po "${commit_short}[0-9a-f]+" | head -n1)" + sri_hash="$(nix-prefetch-github canonical grpc --rev "${commit_hash}" --fetch-submodules | jq -r '.hash')" + + sed -i "s|rev = \".*$|rev = \"${commit_hash}\";|" multipassd.nix + sed -i "s|hash = \".*$|hash = \"${sri_hash}\";|" multipassd.nix +} + + +LATEST_TAG="$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} https://api.github.com/repos/canonical/multipass/releases/latest | jq -r '.tag_name')" +LATEST_VERSION="$(expr "$LATEST_TAG" : 'v\(.*\)')" +CURRENT_VERSION="$(grep -Po "version = \"\K[^\"]+" package.nix)" + +if [[ "$CURRENT_VERSION" == "$LATEST_VERSION" ]]; then + echo "multipass is up to date: ${CURRENT_VERSION}" + exit 0 +fi + +update_pubspec_json "$LATEST_VERSION" + +update_dart_pkg_hash dartssh2 andrei-toterman dartssh2 +update_dart_pkg_hash hotkey_manager_linux andrei-toterman hotkey_manager +update_dart_pkg_hash system_info2 andrei-toterman system_info +update_dart_pkg_hash tray_menu andrei-toterman tray_menu +update_dart_pkg_hash window_size google flutter-desktop-embedding +update_dart_pkg_hash xterm levkropp xterm.dart + +update_multipass_source "$LATEST_VERSION" + +update_grpc_source "$LATEST_VERSION" diff --git a/pkgs/tools/virtualization/multipass/vcpkg_no_install.patch b/pkgs/by-name/mu/multipass/vcpkg_no_install.patch similarity index 100% rename from pkgs/tools/virtualization/multipass/vcpkg_no_install.patch rename to pkgs/by-name/mu/multipass/vcpkg_no_install.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f3c331d76a5f1..5026ed1c1b522 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4417,8 +4417,6 @@ with pkgs; mtr-gui = callPackage ../tools/networking/mtr { withGtk = true; }; - multipass = qt6Packages.callPackage ../tools/virtualization/multipass { }; - multitran = recurseIntoAttrs (let callPackage = newScope pkgs.multitran; in { multitrandata = callPackage ../tools/text/multitran/data { };