netboot.nix/installer/installer.nix
2025-01-01 18:27:07 -05:00

41 lines
1.0 KiB
Nix

{ 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 <<EOF
some text
some lines
EOF
'';
## Old install script
#script = ''
# # Your installation commands here
# if [ ! -f /etc/installation-completed ]; then
# # Run your installation steps
# "${config.myPackages.installFiles}/bin/install.sh"
# # Mark as completed
# touch /etc/installation-completed
# fi
#'';
};
};
}