diff --git a/installer/installer.nix b/installer/installer.nix new file mode 100644 index 0000000..5488783 --- /dev/null +++ b/installer/installer.nix @@ -0,0 +1,26 @@ +{ 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 + + # Mark as completed + touch /etc/installation-completed + fi + ''; + }; + }; +} \ No newline at end of file diff --git a/size-test/base.nix b/size-test/base.nix index 975742a..c06f10e 100644 --- a/size-test/base.nix +++ b/size-test/base.nix @@ -1,7 +1,10 @@ { config, pkgs, lib, ... }: { - imports = [ ../quickly.nix ]; + imports = [ + ../quickly.nix + ../installer/installer.nix + ]; config = { users.users.nixos = { isNormalUser = true;