mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-08-17 04:10:36 +03:00
9.1 KiB
9.1 KiB
Install
Install NixOS with nixos-anywhere
Example
locals {
ipv4 = "192.0.2.1"
}
module "system-build" {
source = "github.com/numtide/nixos-anywhere//terraform/nix-build"
# with flakes
attribute = ".#nixosConfigurations.mymachine.config.system.build.toplevel"
# without flakes
# file can use (pkgs.nixos []) function from nixpkgs
#file = "${path.module}/../.."
#attribute = "config.system.build.toplevel"
}
module "disko" {
source = "github.com/numtide/nixos-anywhere//terraform/nix-build"
# with flakes
attribute = ".#nixosConfigurations.mymachine.config.system.build.diskoScript"
# without flakes
# file can use (pkgs.nixos []) function from nixpkgs
#file = "${path.module}/../.."
#attribute = "config.system.build.diskoScript"
}
module "install" {
source = "github.com/numtide/nixos-anywhere//terraform/install"
nixos_system = module.system-build.result.out
nixos_partitioner = module.disko.result.out
target_host = local.ipv4
}
Requirements
No requirements.
Providers
Name | Version |
---|---|
null | n/a |
Modules
No modules..../joerg/.data/nvim/lazy/
Resources
Name | Type |
---|---|
null_resource.nixos-remote | resource |
Inputs
Name | Description | Type | Default | Required |
---|---|---|---|---|
debug_logging | Enable debug logging | bool |
false |
no |
disk_encryption_key_scripts | Each of these script files will be executed locally and the output of each of them will be made present at the given path to disko during installation. The keys will be not copied to the final system | list(object({ |
[] |
no |
extra_environment | Extra environment variables to be set during installation. This can be usefull to set extra variables for the extra_files_script or disk_encryption_key_scripts | map(string) |
{} |
no |
extra_files_script | A script file that prepares extra files to be copied to the target host during installation. The script expected to write all its files to the current directory. This directory is rsynced to the target host during installation to the / directory. | string |
null |
no |
instance_id | The instance id of the target_host, used to track when to reinstall the machine | string |
null |
no |
kexec_tarball_url | NixOS kexec installer tarball url | string |
null |
no |
nixos_partitioner | nixos partitioner and mount script | string |
n/a | yes |
nixos_system | The nixos system to deploy | string |
n/a | yes |
no_reboot | Do not reboot the machine after installation | bool |
false |
no |
ssh_private_key | Content of private key used to connect to the target_host | string |
"" |
no |
stop_after_disko | Exit after disko formatting | bool |
false |
no |
target_host | DNS host to deploy to | string |
n/a | yes |
target_port | SSH port used to connect to the target_host | number |
22 |
no |
target_user | SSH user used to connect to the target_host | string |
"root" |
no |
Outputs
No outputs.