add config block

This commit is contained in:
2025-01-01 18:27:07 -05:00
parent 96d409b636
commit 912a6b7242
2 changed files with 25 additions and 13 deletions

View File

@@ -1,12 +1,12 @@
{ pkgs, config, lib, ... }:
{ pkgs, config, lib, installFiles, ... }:
{
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.disko ];
preStart = "/run/current-system/sw/bin/sleep 60";
path = [ pkgs.coreutils ];
preStart = "/run/current-system/sw/bin/sleep 4";
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
@@ -14,16 +14,28 @@
StandardOutput = "tty";
StandardError = "tty";
};
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
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
#'';
};
};
}