From 75cc37566a875a0d13e7500c79ec1b99a7864e71 Mon Sep 17 00:00:00 2001 From: reym Date: Wed, 29 Apr 2026 22:49:00 +0200 Subject: [PATCH] update for hetzner --- configuration.nix | 22 ++++++++++++++-------- disko.nix | 10 +++++----- justfile | 8 +++++--- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/configuration.nix b/configuration.nix index 2430cf5..835b180 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,20 +2,26 @@ config, pkgs, lib, + modulesPath, ... }: let - # CHANGE THESE - domain = "git.example.com"; - acmeEmail = "you@example.com"; + domain = "garp.kyrus.dev"; + email = "antoni.romanski@protonmail.com"; sshKeys = [ - "ssh-ed25519 AAAA...replace-with-your-public-key... user@host" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPqKKWflJRNTexs2VaMY3VgF7tPnR7MmxF4yQ6+U9VM hetzner" ]; in { # ─── Boot ────────────────────────────────────────────────────────── - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + }; # ─── Networking ──────────────────────────────────────────────────── networking.hostName = "garp"; @@ -45,7 +51,6 @@ in }; console.keyMap = "de"; - # SSH (needed for nixos-anywhere and later rebuilds) services.openssh = { enable = true; settings = { @@ -80,7 +85,7 @@ in services.caddy = { enable = true; - email = acmeEmail; + email = email; virtualHosts.${domain}.extraConfig = '' reverse_proxy 127.0.0.1:3000 ''; @@ -92,6 +97,7 @@ in btop tmux curl + config.services.forgejo.package ]; # VM-only overrides (applied by `nixos-rebuild build-vm`) diff --git a/disko.nix b/disko.nix index 0005656..34b0864 100644 --- a/disko.nix +++ b/disko.nix @@ -1,14 +1,14 @@ { disko.devices.disk.main = { - # CHANGE THIS to match the target disk: - # /dev/sda — typical SATA / SCSI - # /dev/vda — KVM / QEMU virtio - # /dev/nvme0n1 — NVMe - device = "/dev/vda"; + device = "/dev/sda"; type = "disk"; content = { type = "gpt"; partitions = { + boot = { + size = "1M"; + type = "EF02"; + }; ESP = { size = "512M"; type = "EF00"; diff --git a/justfile b/justfile index 299399c..0942679 100644 --- a/justfile +++ b/justfile @@ -1,11 +1,13 @@ # https://just.systems +domain := "garp.kyrus.dev" + default: echo 'Hello, world!' vm: nixos-rebuild build-vm --flake .#server ./result/bin/run-garp-vm -nographic - - rebuild-remote: - nixos-rebuild switch --flake .#garp --target-host root@{{ domain }} + +rebuild-remote: + nixos-rebuild switch --flake .#garp --target-host root@{{ domain }}