diff --git a/config/initrd-include/etc/configuration.nix b/config/initrd-include/etc/configuration.nix index 409f884..c507da2 100644 --- a/config/initrd-include/etc/configuration.nix +++ b/config/initrd-include/etc/configuration.nix @@ -10,7 +10,7 @@ ./hardware-configuration.nix ./diskco.nix ]; - + config = { # Bootloader. boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; @@ -162,5 +162,5 @@ fi # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.11"; # Did you read the comment? - +}; } \ No newline at end of file diff --git a/installer/installer.nix b/installer/installer.nix index 1bc0059..99e0994 100644 --- a/installer/installer.nix +++ b/installer/installer.nix @@ -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 <