Install NixOS on Hetzner Cloud: Difference between revisions

mNo edit summary
mNo edit summary
Line 35: Line 35:
#Open Hetzner Cloud console web page, find the <code>my-hetzner-vm</code> server, open a remote web terminal (aka "VNC over "wss://") and change password of <code>nixos</code> user to <code>my-temp-password-123</code>:[[File:Prompt_with_a_token.png|right|frameless|197x197px]]
#Open Hetzner Cloud console web page, find the <code>my-hetzner-vm</code> server, open a remote web terminal (aka "VNC over "wss://") and change password of <code>nixos</code> user to <code>my-temp-password-123</code>:[[File:Prompt_with_a_token.png|right|frameless|197x197px]]
# On your host computer, create a folder. Run:<syntaxhighlight lang="shell">
# On your host computer, create a folder. Run:<syntaxhighlight lang="shell">
mkdir -p /tmp/my-first-flake/my-systems/my-hetzner-vm/
mkdir -p /tmp/my-first-flake/my-vms/my-hetzner-vm/
</syntaxhighlight>
</syntaxhighlight>
#Using a code editor on your host computer, create 4 files. File contents, as well as the location of where to put corresponding file are indicated below:<syntaxhighlight lang="nix">
#Using a code editor on your host computer, create 4 files. File contents, as well as the location of where to put corresponding file are indicated below:<syntaxhighlight lang="nix">
# /tmp/my-first-flake/my-systems/my-hetzner-vm/hardware-configuration.nix
# /tmp/my-first-flake/my-vms/my-hetzner-vm/hardware-configuration.nix


{ config, lib, pkgs, modulesPath, ... }:
{ config, lib, pkgs, modulesPath, ... }:
Line 56: Line 56:
}
}
</syntaxhighlight><syntaxhighlight lang="nix">
</syntaxhighlight><syntaxhighlight lang="nix">
# /tmp/my-first-flake/my-systems/my-hetzner-vm/disko-config.nix
# /tmp/my-first-flake/my-vms/my-hetzner-vm/disko-config.nix


{
{
Line 96: Line 96:
}
}
</syntaxhighlight><syntaxhighlight lang="nix">
</syntaxhighlight><syntaxhighlight lang="nix">
# /tmp/my-first-flake/my-systems/my-hetzner-vm/configuration.nix
# /tmp/my-first-flake/my-vms/my-hetzner-vm/configuration.nix


{ config, lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
Line 160: Line 160:


         modules = [
         modules = [
           ./my-systems/my-hetzner-vm/configuration.nix
           ./my-vms/my-hetzner-vm/configuration.nix
           inputs.disko.nixosModules.disko
           inputs.disko.nixosModules.disko
         ];
         ];