- Remove vmsilo-start-* user-facing symlinks from package.nix (internal VM launcher scripts are only used by systemd ExecStart, not by users) - Rename vmsilo-usb to vm-usb to match the vm-* naming convention - Increase socat -t timeout in vm-run from default 0.5s to 5s to fix missing output from console commands (cloud-hypervisor proxy startup latency exceeded the default timeout window) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
57 lines
1.4 KiB
Nix
57 lines
1.4 KiB
Nix
# Package assembly for vmsilo NixOS module
|
|
# Bundles all scripts and configures environment
|
|
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.programs.vmsilo;
|
|
|
|
# Generate the package with all scripts
|
|
vmPackage = pkgs.runCommand "vmsilo-scripts" { } ''
|
|
mkdir -p $out/bin
|
|
mkdir -p $out/share/bash-completion/completions
|
|
|
|
# User-facing scripts
|
|
${lib.concatMapStringsSep "\n" (name: ''
|
|
ln -s ${cfg._internal.userScripts.${name}} $out/bin/${name}
|
|
'') (lib.attrNames cfg._internal.userScripts)}
|
|
|
|
# Link crosvm for convenience
|
|
ln -s ${cfg._internal.crosvm}/bin/crosvm $out/bin/crosvm
|
|
|
|
# Bash completions
|
|
${lib.optionalString cfg.enableBashIntegration ''
|
|
for cmd in vm-run vm-start vm-stop vm-shell vm-usb; do
|
|
ln -s ${cfg._internal.bashCompletionScript} $out/share/bash-completion/completions/$cmd
|
|
done
|
|
''}
|
|
'';
|
|
in
|
|
{
|
|
config = lib.mkIf cfg.enable {
|
|
# Set the package output
|
|
programs.vmsilo.package = vmPackage;
|
|
|
|
# Add scripts and desktop files to system PATH
|
|
environment.systemPackages = [
|
|
vmPackage
|
|
cfg._internal.desktopFilesPackage
|
|
];
|
|
|
|
# Ensure required paths are linked
|
|
environment.pathsToLink = [
|
|
"/share/applications"
|
|
"/share/desktop-directories"
|
|
"/share/icons"
|
|
"/share/pixmaps"
|
|
"/etc/xdg/menus"
|
|
]
|
|
++ lib.optionals cfg.enableBashIntegration [
|
|
"/share/bash-completion"
|
|
];
|
|
};
|
|
}
|