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

@@ -22,7 +22,26 @@
walker.url = "github:abenz1267/walker";
};
outputs = { self, nixpkgs, nixos-hardware, disko, impermanence, home-manager, nix-colors, stylix, walker, ... } @ inputs: {
outputs = { self, nixpkgs, nixos-hardware, disko, impermanence, home-manager, nix-colors, stylix, walker, ... } @ inputs: let
# Helper to create standalone home configurations
mkHome = { username, modules ? [] }: home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs; };
modules = [
./features
{
home.username = username;
home.homeDirectory = "/home/${username}";
home.stateVersion = "25.11";
}
] ++ modules;
};
homeConfigs = {
"nixos" = mkHome { username = "nixos"; };
"nomarchy" = mkHome { username = "nomarchy"; };
};
in {
# Expose inputs for downstream use
inherit inputs;
@@ -48,7 +67,10 @@
# Graphical installer ISO (legacy, for users who prefer GUI)
installerIsoGraphical = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
specialArgs = {
inherit inputs;
homeActivationPackage = homeConfigs."nixos".activationPackage;
};
modules = [
{ nixpkgs.hostPlatform = "x86_64-linux"; }
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-base.nix"
@@ -64,7 +86,10 @@
# Default configuration (VM and testing)
default = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
specialArgs = {
inherit inputs;
homeActivationPackage = homeConfigs."nomarchy".activationPackage;
};
modules = [
{ nixpkgs.hostPlatform = "x86_64-linux"; }
./core/default.nix
@@ -90,34 +115,6 @@
};
};
homeConfigurations = {
# Standalone Home Manager configuration for Live ISO
"nixos" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs; };
modules = [
./features
{
home.username = "nixos";
home.homeDirectory = "/home/nixos";
home.stateVersion = "25.11";
}
];
};
# Standalone Home Manager configuration for VM testing
"nomarchy" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs; };
modules = [
./features
{
home.username = "nomarchy";
home.homeDirectory = "/home/nomarchy";
home.stateVersion = "25.11";
}
];
};
};
homeConfigurations = homeConfigs;
};
}