feat: pre-activate standalone Home Manager environment in VM and Live ISO

This commit is contained in:
Bernardo Magri
2026-04-13 15:24:51 +01:00
parent d3042c4fb6
commit 2d587d40ff
3 changed files with 59 additions and 34 deletions

View File

@@ -1,6 +1,20 @@
{ inputs, lib, ... }:
{ inputs, lib, pkgs, homeActivationPackage ? null, ... }:
{
# Pre-activate standalone home-manager if provided
system.activationScripts.home-manager-activate = lib.mkIf (homeActivationPackage != null) {
text = ''
USER_HOME="/home/nomarchy"
if [ ! -d "$USER_HOME" ]; then
mkdir -p "$USER_HOME"
chown nomarchy:users "$USER_HOME"
fi
# Run activation as the nomarchy user
${pkgs.sudo}/bin/sudo -u nomarchy ${homeActivationPackage}/activate
'';
deps = [ "users" ];
};
# Shared VM configuration
virtualisation.vmVariant = {
virtualisation.graphics = true;