add config block
This commit is contained in:
parent
96d409b636
commit
912a6b7242
@ -10,7 +10,7 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./diskco.nix
|
./diskco.nix
|
||||||
];
|
];
|
||||||
|
config = {
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.grub.enable = true;
|
||||||
boot.loader.grub.device = "/dev/sda";
|
boot.loader.grub.device = "/dev/sda";
|
||||||
@ -162,5 +162,5 @@ fi
|
|||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "24.11"; # Did you read the comment?
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@ -1,12 +1,12 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
{ pkgs, config, lib, installFiles, ... }:
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
systemd.services.custom-install = {
|
systemd.services.custom-install = {
|
||||||
description = "Custom installation script";
|
description = "Custom installation script";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
path = [ pkgs.util-linux pkgs.parted pkgs.nixos-install-tools pkgs.nixos-anywhere pkgs.disko ];
|
path = [ pkgs.coreutils ];
|
||||||
preStart = "/run/current-system/sw/bin/sleep 60";
|
preStart = "/run/current-system/sw/bin/sleep 4";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
@ -14,16 +14,28 @@
|
|||||||
StandardOutput = "tty";
|
StandardOutput = "tty";
|
||||||
StandardError = "tty";
|
StandardError = "tty";
|
||||||
};
|
};
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
# Your installation commands here
|
mkdir /home/nixos/installer
|
||||||
if [ ! -f /etc/installation-completed ]; then
|
cp -R ${config.myPackages.installFiles}/ /home/nixos/installer
|
||||||
# Run your installation steps
|
ln
|
||||||
"${config.myPackages.installFiles}/bin/install.sh"
|
|
||||||
# Mark as completed
|
cat > output.txt <<EOF
|
||||||
touch /etc/installation-completed
|
some text
|
||||||
fi
|
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
|
||||||
|
#'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user