1. Registry
  2. Packages
  3. nixos-vps
  4. API Docs
  5. hetzner
  6. NixosServer
Viewing docs for nixos-vps v0.2.0
published on Thursday, Oct 29, 2026 by sgomezsal
nixos-vps
Viewing docs for nixos-vps v0.2.0
published on Thursday, Oct 29, 2026 by sgomezsal

    Creates a fresh server, SSH key and firewall, then performs one initial NixOS installation. Routine updates use nixos-rebuild.

    Create NixosServer Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new NixosServer(name: string, args: NixosServerArgs, opts?: ComponentResourceOptions);
    @overload
    def NixosServer(resource_name: str,
                    args: NixosServerArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def NixosServer(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    installer: Optional[str] = None,
                    configuration: Optional[str] = None,
                    ssh_public_key_path: Optional[str] = None,
                    ssh_private_key_path: Optional[str] = None,
                    ssh_host_key_private_path: Optional[str] = None,
                    flake_directory: Optional[str] = None,
                    expected_disk_serial: Optional[str] = None,
                    labels: Optional[Mapping[str, str]] = None,
                    location: Optional[str] = None,
                    server_type: Optional[str] = None,
                    bootstrap_image: Optional[str] = None,
                    expected_disk: Optional[str] = None,
                    existing_ssh_key_ids: Optional[Sequence[str]] = None,
                    ssh_source_ips: Optional[Sequence[str]] = None,
                    ssh_timeout_seconds: Optional[int] = None,
                    tcp_ports: Optional[Sequence[int]] = None)
    func NewNixosServer(ctx *Context, name string, args NixosServerArgs, opts ...ResourceOption) (*NixosServer, error)
    public NixosServer(string name, NixosServerArgs args, ComponentResourceOptions? opts = null)
    public NixosServer(String name, NixosServerArgs args)
    public NixosServer(String name, NixosServerArgs args, ComponentResourceOptions options)
    
    type: nixos-vps:hetzner:NixosServer
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "nixos-vps_hetzner_nixos_server" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args NixosServerArgs
    The arguments to resource properties.
    opts ComponentResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args NixosServerArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args NixosServerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NixosServerArgs
    The arguments to resource properties.
    opts ComponentResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NixosServerArgs
    The arguments to resource properties.
    options ComponentResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var nixosServerResource = new NixosVps.Hetzner.NixosServer("nixosServerResource", new()
    {
        Installer = "string",
        Configuration = "string",
        SshPublicKeyPath = "string",
        SshPrivateKeyPath = "string",
        SshHostKeyPrivatePath = "string",
        FlakeDirectory = "string",
        ExpectedDiskSerial = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Location = "string",
        ServerType = "string",
        BootstrapImage = "string",
        ExpectedDisk = "string",
        ExistingSshKeyIds = new[]
        {
            "string",
        },
        SshSourceIps = new[]
        {
            "string",
        },
        SshTimeoutSeconds = 0,
        TcpPorts = new()
        {
            0,
        },
    });
    
    example, err := hetzner.NewNixosServer(ctx, "nixosServerResource", &hetzner.NixosServerArgs{
    	Installer:             "string",
    	Configuration:         "string",
    	SshPublicKeyPath:      "string",
    	SshPrivateKeyPath:     "string",
    	SshHostKeyPrivatePath: "string",
    	FlakeDirectory:        "string",
    	ExpectedDiskSerial:    "string",
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Location:       pulumi.String("string"),
    	ServerType:     pulumi.String("string"),
    	BootstrapImage: pulumi.String("string"),
    	ExpectedDisk:   "string",
    	ExistingSshKeyIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SshSourceIps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SshTimeoutSeconds: 0,
    	TcpPorts: []int{
    		0,
    	},
    })
    
    resource "nixos-vps_hetzner_nixos_server" "nixosServerResource" {
      lifecycle {
        create_before_destroy = true
      }
      installer                 = "string"
      configuration             = "string"
      ssh_public_key_path       = "string"
      ssh_private_key_path      = "string"
      ssh_host_key_private_path = "string"
      flake_directory           = "string"
      expected_disk_serial      = "string"
      labels = {
        "string" = "string"
      }
      location             = "string"
      server_type          = "string"
      bootstrap_image      = "string"
      expected_disk        = "string"
      existing_ssh_key_ids = ["string"]
      ssh_source_ips       = ["string"]
      ssh_timeout_seconds  = 0
      tcp_ports            = [0]
    }
    
    var nixosServerResource = new NixosServer("nixosServerResource", NixosServerArgs.builder()
        .installer("string")
        .configuration("string")
        .sshPublicKeyPath("string")
        .sshPrivateKeyPath("string")
        .sshHostKeyPrivatePath("string")
        .flakeDirectory("string")
        .expectedDiskSerial("string")
        .labels(Map.of("string", "string"))
        .location("string")
        .serverType("string")
        .bootstrapImage("string")
        .expectedDisk("string")
        .existingSshKeyIds("string")
        .sshSourceIps("string")
        .sshTimeoutSeconds(0)
        .tcpPorts(0)
        .build());
    
    nixos_server_resource = nixos_vps.hetzner.NixosServer("nixosServerResource",
        installer="string",
        configuration="string",
        ssh_public_key_path="string",
        ssh_private_key_path="string",
        ssh_host_key_private_path="string",
        flake_directory="string",
        expected_disk_serial="string",
        labels={
            "string": "string",
        },
        location="string",
        server_type="string",
        bootstrap_image="string",
        expected_disk="string",
        existing_ssh_key_ids=["string"],
        ssh_source_ips=["string"],
        ssh_timeout_seconds=0,
        tcp_ports=[0])
    
    const nixosServerResource = new nixos_vps.hetzner.NixosServer("nixosServerResource", {
        installer: "string",
        configuration: "string",
        sshPublicKeyPath: "string",
        sshPrivateKeyPath: "string",
        sshHostKeyPrivatePath: "string",
        flakeDirectory: "string",
        expectedDiskSerial: "string",
        labels: {
            string: "string",
        },
        location: "string",
        serverType: "string",
        bootstrapImage: "string",
        expectedDisk: "string",
        existingSshKeyIds: ["string"],
        sshSourceIps: ["string"],
        sshTimeoutSeconds: 0,
        tcpPorts: [0],
    });
    
    type: nixos-vps:hetzner:NixosServer
    properties:
        bootstrapImage: string
        configuration: string
        existingSshKeyIds:
            - string
        expectedDisk: string
        expectedDiskSerial: string
        flakeDirectory: string
        installer: string
        labels:
            string: string
        location: string
        serverType: string
        sshHostKeyPrivatePath: string
        sshPrivateKeyPath: string
        sshPublicKeyPath: string
        sshSourceIps:
            - string
        sshTimeoutSeconds: 0
        tcpPorts:
            - 0
    

    NixosServer Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The NixosServer resource accepts the following input properties:

    Configuration string
    Attribute under nixosConfigurations, for example web.
    FlakeDirectory string
    Absolute local directory containing the consumer flake and flake.lock.
    Installer string
    Absolute local flake package reference or explicit pinned installer flake URL.
    SshHostKeyPrivatePath string
    Absolute path to the separate Ed25519 server host private key.
    SshPrivateKeyPath string
    Absolute path to the deployment private key; keep it outside the flake.
    SshPublicKeyPath string
    Absolute path to the deployment public key.
    BootstrapImage string
    Ubuntu or Debian bootstrap image; defaults to ubuntu-24.04.
    ExistingSshKeyIds List<string>
    Optional registered deployment SSH key IDs; omit to register a key.
    ExpectedDisk string
    Expected whole disk; defaults to /dev/sda.
    ExpectedDiskSerial string
    Optional externally verified disk serial.
    Labels Dictionary<string, string>
    Public Hetzner server labels.
    Location string
    Hetzner location code; defaults to nbg1.
    ServerType string
    x86_64 CX, CPX or CCX plan; defaults to cpx22.
    SshSourceIps List<string>
    Allowed SSH sources; include the deployment runner. Defaults to public IPv4/IPv6.
    SshTimeoutSeconds int
    SSH readiness timeout in seconds, between 1 and 3600; defaults to 600.
    TcpPorts List<int>
    Additional inbound TCP ports. The NixOS firewall must also allow them.
    Configuration string
    Attribute under nixosConfigurations, for example web.
    FlakeDirectory string
    Absolute local directory containing the consumer flake and flake.lock.
    Installer string
    Absolute local flake package reference or explicit pinned installer flake URL.
    SshHostKeyPrivatePath string
    Absolute path to the separate Ed25519 server host private key.
    SshPrivateKeyPath string
    Absolute path to the deployment private key; keep it outside the flake.
    SshPublicKeyPath string
    Absolute path to the deployment public key.
    BootstrapImage string
    Ubuntu or Debian bootstrap image; defaults to ubuntu-24.04.
    ExistingSshKeyIds []string
    Optional registered deployment SSH key IDs; omit to register a key.
    ExpectedDisk string
    Expected whole disk; defaults to /dev/sda.
    ExpectedDiskSerial string
    Optional externally verified disk serial.
    Labels map[string]string
    Public Hetzner server labels.
    Location string
    Hetzner location code; defaults to nbg1.
    ServerType string
    x86_64 CX, CPX or CCX plan; defaults to cpx22.
    SshSourceIps []string
    Allowed SSH sources; include the deployment runner. Defaults to public IPv4/IPv6.
    SshTimeoutSeconds int
    SSH readiness timeout in seconds, between 1 and 3600; defaults to 600.
    TcpPorts []int
    Additional inbound TCP ports. The NixOS firewall must also allow them.
    configuration string
    Attribute under nixosConfigurations, for example web.
    flake_directory string
    Absolute local directory containing the consumer flake and flake.lock.
    installer string
    Absolute local flake package reference or explicit pinned installer flake URL.
    ssh_host_key_private_path string
    Absolute path to the separate Ed25519 server host private key.
    ssh_private_key_path string
    Absolute path to the deployment private key; keep it outside the flake.
    ssh_public_key_path string
    Absolute path to the deployment public key.
    bootstrap_image string
    Ubuntu or Debian bootstrap image; defaults to ubuntu-24.04.
    existing_ssh_key_ids list(string)
    Optional registered deployment SSH key IDs; omit to register a key.
    expected_disk string
    Expected whole disk; defaults to /dev/sda.
    expected_disk_serial string
    Optional externally verified disk serial.
    labels map(string)
    Public Hetzner server labels.
    location string
    Hetzner location code; defaults to nbg1.
    server_type string
    x86_64 CX, CPX or CCX plan; defaults to cpx22.
    ssh_source_ips list(string)
    Allowed SSH sources; include the deployment runner. Defaults to public IPv4/IPv6.
    ssh_timeout_seconds number
    SSH readiness timeout in seconds, between 1 and 3600; defaults to 600.
    tcp_ports list(number)
    Additional inbound TCP ports. The NixOS firewall must also allow them.
    configuration String
    Attribute under nixosConfigurations, for example web.
    flakeDirectory String
    Absolute local directory containing the consumer flake and flake.lock.
    installer String
    Absolute local flake package reference or explicit pinned installer flake URL.
    sshHostKeyPrivatePath String
    Absolute path to the separate Ed25519 server host private key.
    sshPrivateKeyPath String
    Absolute path to the deployment private key; keep it outside the flake.
    sshPublicKeyPath String
    Absolute path to the deployment public key.
    bootstrapImage String
    Ubuntu or Debian bootstrap image; defaults to ubuntu-24.04.
    existingSshKeyIds List<String>
    Optional registered deployment SSH key IDs; omit to register a key.
    expectedDisk String
    Expected whole disk; defaults to /dev/sda.
    expectedDiskSerial String
    Optional externally verified disk serial.
    labels Map<String,String>
    Public Hetzner server labels.
    location String
    Hetzner location code; defaults to nbg1.
    serverType String
    x86_64 CX, CPX or CCX plan; defaults to cpx22.
    sshSourceIps List<String>
    Allowed SSH sources; include the deployment runner. Defaults to public IPv4/IPv6.
    sshTimeoutSeconds Integer
    SSH readiness timeout in seconds, between 1 and 3600; defaults to 600.
    tcpPorts List<Integer>
    Additional inbound TCP ports. The NixOS firewall must also allow them.
    configuration string
    Attribute under nixosConfigurations, for example web.
    flakeDirectory string
    Absolute local directory containing the consumer flake and flake.lock.
    installer string
    Absolute local flake package reference or explicit pinned installer flake URL.
    sshHostKeyPrivatePath string
    Absolute path to the separate Ed25519 server host private key.
    sshPrivateKeyPath string
    Absolute path to the deployment private key; keep it outside the flake.
    sshPublicKeyPath string
    Absolute path to the deployment public key.
    bootstrapImage string
    Ubuntu or Debian bootstrap image; defaults to ubuntu-24.04.
    existingSshKeyIds string[]
    Optional registered deployment SSH key IDs; omit to register a key.
    expectedDisk string
    Expected whole disk; defaults to /dev/sda.
    expectedDiskSerial string
    Optional externally verified disk serial.
    labels {[key: string]: string}
    Public Hetzner server labels.
    location string
    Hetzner location code; defaults to nbg1.
    serverType string
    x86_64 CX, CPX or CCX plan; defaults to cpx22.
    sshSourceIps string[]
    Allowed SSH sources; include the deployment runner. Defaults to public IPv4/IPv6.
    sshTimeoutSeconds number
    SSH readiness timeout in seconds, between 1 and 3600; defaults to 600.
    tcpPorts number[]
    Additional inbound TCP ports. The NixOS firewall must also allow them.
    configuration str
    Attribute under nixosConfigurations, for example web.
    flake_directory str
    Absolute local directory containing the consumer flake and flake.lock.
    installer str
    Absolute local flake package reference or explicit pinned installer flake URL.
    ssh_host_key_private_path str
    Absolute path to the separate Ed25519 server host private key.
    ssh_private_key_path str
    Absolute path to the deployment private key; keep it outside the flake.
    ssh_public_key_path str
    Absolute path to the deployment public key.
    bootstrap_image str
    Ubuntu or Debian bootstrap image; defaults to ubuntu-24.04.
    existing_ssh_key_ids Sequence[str]
    Optional registered deployment SSH key IDs; omit to register a key.
    expected_disk str
    Expected whole disk; defaults to /dev/sda.
    expected_disk_serial str
    Optional externally verified disk serial.
    labels Mapping[str, str]
    Public Hetzner server labels.
    location str
    Hetzner location code; defaults to nbg1.
    server_type str
    x86_64 CX, CPX or CCX plan; defaults to cpx22.
    ssh_source_ips Sequence[str]
    Allowed SSH sources; include the deployment runner. Defaults to public IPv4/IPv6.
    ssh_timeout_seconds int
    SSH readiness timeout in seconds, between 1 and 3600; defaults to 600.
    tcp_ports Sequence[int]
    Additional inbound TCP ports. The NixOS firewall must also allow them.
    configuration String
    Attribute under nixosConfigurations, for example web.
    flakeDirectory String
    Absolute local directory containing the consumer flake and flake.lock.
    installer String
    Absolute local flake package reference or explicit pinned installer flake URL.
    sshHostKeyPrivatePath String
    Absolute path to the separate Ed25519 server host private key.
    sshPrivateKeyPath String
    Absolute path to the deployment private key; keep it outside the flake.
    sshPublicKeyPath String
    Absolute path to the deployment public key.
    bootstrapImage String
    Ubuntu or Debian bootstrap image; defaults to ubuntu-24.04.
    existingSshKeyIds List<String>
    Optional registered deployment SSH key IDs; omit to register a key.
    expectedDisk String
    Expected whole disk; defaults to /dev/sda.
    expectedDiskSerial String
    Optional externally verified disk serial.
    labels Map<String>
    Public Hetzner server labels.
    location String
    Hetzner location code; defaults to nbg1.
    serverType String
    x86_64 CX, CPX or CCX plan; defaults to cpx22.
    sshSourceIps List<String>
    Allowed SSH sources; include the deployment runner. Defaults to public IPv4/IPv6.
    sshTimeoutSeconds Number
    SSH readiness timeout in seconds, between 1 and 3600; defaults to 600.
    tcpPorts List<Number>
    Additional inbound TCP ports. The NixOS firewall must also allow them.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NixosServer resource produces the following output properties:

    Ipv4 string
    IPv4 address, resolved only after initial installation and SSH readiness.
    ServerId string
    Hetzner server ID.
    Ipv4 string
    IPv4 address, resolved only after initial installation and SSH readiness.
    ServerId string
    Hetzner server ID.
    ipv4 string
    IPv4 address, resolved only after initial installation and SSH readiness.
    server_id string
    Hetzner server ID.
    ipv4 String
    IPv4 address, resolved only after initial installation and SSH readiness.
    serverId String
    Hetzner server ID.
    ipv4 string
    IPv4 address, resolved only after initial installation and SSH readiness.
    serverId string
    Hetzner server ID.
    ipv4 str
    IPv4 address, resolved only after initial installation and SSH readiness.
    server_id str
    Hetzner server ID.
    ipv4 String
    IPv4 address, resolved only after initial installation and SSH readiness.
    serverId String
    Hetzner server ID.

    Package Details

    Repository
    nixos-vps sgomezsal/nixos-vps
    License
    MIT
    nixos-vps
    Viewing docs for nixos-vps v0.2.0
    published on Thursday, Oct 29, 2026 by sgomezsal

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial