diff --git a/nix/base-system/darwin-configuration.nix b/nix/base-system/darwin-configuration.nix index 27a9aef..417ecf4 100644 --- a/nix/base-system/darwin-configuration.nix +++ b/nix/base-system/darwin-configuration.nix @@ -1,4 +1,7 @@ { pkgs, config, lib, ... }: +let + vfkit = pkgs.callPackage ../packages/vfkit.nix {}; +in { nix = { @@ -283,6 +286,9 @@ # Use a custom configuration.nix location. # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix"; + environment.systemPackages = [ + vfkit + ]; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; diff --git a/nix/base-system/flake.lock b/nix/base-system/flake.lock index 35df657..e8a8700 100644 --- a/nix/base-system/flake.lock +++ b/nix/base-system/flake.lock @@ -1116,11 +1116,11 @@ }, "unstable": { "locked": { - "lastModified": 1706367331, - "narHash": "sha256-AqgkGHRrI6h/8FWuVbnkfFmXr4Bqsr4fV23aISqj/xg=", + "lastModified": 1718870667, + "narHash": "sha256-jab3Kpc8O1z3qxwVsCMHL4+18n5Wy/HHKyu1fcsF7gs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "160b762eda6d139ac10ae081f8f78d640dd523eb", + "rev": "9b10b8f00cb5494795e5f51b39210fed4d2b0748", "type": "github" }, "original": { diff --git a/nix/base-system/flake.nix b/nix/base-system/flake.nix index 2e882ac..cb7b468 100644 --- a/nix/base-system/flake.nix +++ b/nix/base-system/flake.nix @@ -252,6 +252,7 @@ EOF"; durnitisp = durnitisp; clio = clio; victoria-logs = pkgs.callPackage ../packages/victoria-logs.nix { }; + podman = unstablePkgs.podman; }) rust-overlay ]; @@ -306,6 +307,7 @@ EOF"; ghidra #podman-desktop # Broken on darwin right now with electron build issues. # Note that podman expects qemu to be installed in order to use the podman machine setup. + podman qemu lima rlwrap diff --git a/nix/packages/vfkit.nix b/nix/packages/vfkit.nix new file mode 100644 index 0000000..cca708a --- /dev/null +++ b/nix/packages/vfkit.nix @@ -0,0 +1,39 @@ +{ lib, fetchurl, stdenvNoCC, testers }: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "vfkit"; + version = "0.5.1"; + + src = fetchurl { + url = "https://github.com/crc-org/vfkit/releases/download/v${finalAttrs.version}/vfkit"; + hash = "sha256-at+KsvsKO359d4VUvcSuio2ej5hM6//U4Mj/jqXwhEc="; + }; + + dontUnpack = true; + + installPhase = '' + runHook preInstall + + install -Dm755 $src $out/bin/vfkit + + runHook postInstall + ''; + + passthru.tests = { + version = testers.testVersion { + package = finalAttrs.finalPackage; + }; + }; + + meta = { + description = "Simple command line tool to start VMs through virtualization framework"; + homepage = "https://github.com/crc-org/vfkit"; + license = lib.licenses.asl20; + maintainers = [ ]; + platforms = lib.platforms.darwin; + # Source build will be possible after darwin SDK 12.0 bump + # https://github.com/NixOS/nixpkgs/pull/229210 + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + mainProgram = "vfkit"; + }; +})