{ pkgs, config, lib, installFiles, ... }: { config = { systemd.services.custom-install = { description = "Custom installation script"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; path = [ pkgs.coreutils ]; preStart = "/run/current-system/sw/bin/sleep 4"; serviceConfig = { Type = "oneshot"; RemainAfterExit = true; TTYPath = /dev/tty1; # or whichever TTY you want to use StandardOutput = "tty"; StandardError = "tty"; }; script = '' mkdir /home/nixos/installer cp -R ${config.myPackages.installFiles}/ /home/nixos/installer ln cat > output.txt <