netboot.nix/installer/installer.nix

26 lines
696 B
Nix

{ pkgs, config, lib, ... }:
{
config = {
systemd.services.custom-install = {
description = "Custom installation script";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
path = [ pkgs.util-linux pkgs.parted pkgs.nixos-install-tools pkgs.nixos-anywhere pkgs.diskco ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
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
'';
};
};
}