Skip to content

Commit

Permalink
nixos-modules/host: add activationScripts warning
Browse files Browse the repository at this point in the history
  • Loading branch information
astro committed Nov 24, 2024
1 parent 21ae51f commit 0f5d7d6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions nixos-modules/host/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,23 @@ in

# Enable Kernel Same-Page Merging
hardware.ksm.enable = lib.mkDefault true;

# TODO: remove in 2026
system.activationScripts.microvm-virtiofsd-check = ''
if [ -d ${stateDir} ]; then
_microvms_with_virtiofsd=""
for dir in ${stateDir}/*; do
if [ -e $dir/current/share/microvm/virtiofs ] &&
[ ! -e $dir/bin/virtiofsd-run ]; then
_microvms_with_virtiofsd="$_microvms_with_virtiofsd $(basename $dir)"
fi
done
if [ "$_microvms_with_virtiofsd" != "" ]; then
echo "The following MicroVMs must be updated to follow the new virtiofsd scheme: $_microvms_with_virtiofsd"
fi
fi
'';
};
}

0 comments on commit 0f5d7d6

Please sign in to comment.