26 lines
695 B
Nix
26 lines
695 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.disko ];
|
|
|
|
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
|
|
'';
|
|
};
|
|
};
|
|
} |