Skip to content

Commit

Permalink
add: hkg2
Browse files Browse the repository at this point in the history
  • Loading branch information
jz8132543 committed Sep 7, 2024
1 parent 1a2d689 commit 370274d
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flake/hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ in {
name = "dfw0";
system = "x86_64-linux";
})
(mkHost {
name = "hkg2";
system = "x86_64-linux";
})
(mkHost {
name = "fra1";
system = "x86_64-linux";
Expand Down
8 changes: 8 additions & 0 deletions nixago/sops-yaml.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@
key = "age1tvfl7y78hv2egs45nqtp7nlydqrrq2twjr47m2028lh68qtqwuxs9wxk3v";
owned = true;
};
fra1 = {
key = "age15l3xz5gddpnml7us007rfd97ntvj60vdezj9gz729z5j20m864dqh07tey";
owned = true;
};
};
dfw0 = {
key = "age1t8qhcsypu2q8n2dnc5ga08dnvdscem764e2eyfgvq5mmja66m5aq003sl2";
owned = true;
};
ownedHostKeys = lib.mapAttrsToList (_: cfg: cfg.key) (lib.filterAttrs (_: cfg: cfg.owned) hosts);
allHostKeys = lib.mapAttrsToList (_: cfg: cfg.key) hosts;

Expand Down
21 changes: 21 additions & 0 deletions nixos/hosts/hkg2/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
nixosModules,
lib,
...
}: {
imports =
nixosModules.cloud.all
++ nixosModules.users.tippy.all
++ nixosModules.services.mail.all
++ [
./hardware-configuration.nix
nixosModules.services.traefik
nixosModules.services.derp
nixosModules.services.proxy
nixosModules.services.tuic
nixosModules.services.searx
nixosModules.services.rustdesk
nixosModules.services.sogo
];
nix.gc.options = lib.mkForce "-d";
}
34 changes: 34 additions & 0 deletions nixos/hosts/hkg2/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];

boot.initrd.availableKernelModules = ["ata_piix" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk"];
# utils.disk = "/dev/sda";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
networking = {
# useDHCP = false;
# useNetworkd = true;
interfaces.eth0 = {
useDHCP = false;
ipv4.addresses = [
{
address = "123.254.105.134";
prefixLength = 24;
}
];
};
defaultGateway = "123.254.105.158";
};

swapDevices = [
{
device = "/swap/swapfile";
size = 4096;
}
];
}
13 changes: 13 additions & 0 deletions terraform/hosts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ locals {
endpoints_v4 = []
endpoints_v6 = []
}
hkg2 = {
records = {
a = {
proxied = false
type = "A"
value = "123.254.105.134"
}
}
ddns_records = {}
host_indices = [5]
endpoints_v4 = []
endpoints_v6 = []
}
isk = {
records = {}
ddns_records = {
Expand Down

0 comments on commit 370274d

Please sign in to comment.