feat(servers): add loki, the tricker.
This commit is contained in:
parent
e88bccf101
commit
926884f6bf
20
flake.nix
20
flake.nix
@ -107,6 +107,15 @@
|
||||
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.heimdall;
|
||||
};
|
||||
};
|
||||
|
||||
loki = {
|
||||
hostname = "loki";
|
||||
profiles.system = {
|
||||
sshUser = "root";
|
||||
user = "root";
|
||||
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.loki;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
@ -162,6 +171,17 @@
|
||||
];
|
||||
};
|
||||
|
||||
loki = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
./hosts/loki/configuration.nix
|
||||
./modules/servers/general
|
||||
./modules/servers/loki
|
||||
];
|
||||
};
|
||||
|
||||
nixos = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
modules = [
|
||||
|
27
hosts/loki/configuration.nix
Normal file
27
hosts/loki/configuration.nix
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
modulesPath,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
./disk-config.nix
|
||||
];
|
||||
|
||||
networking.hostName = "loki";
|
||||
|
||||
boot.loader.grub = {
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = map lib.lowPrio [
|
||||
pkgs.curl
|
||||
pkgs.neovim
|
||||
pkgs.gitMinimal
|
||||
];
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
54
hosts/loki/disk-config.nix
Normal file
54
hosts/loki/disk-config.nix
Normal file
@ -0,0 +1,54 @@
|
||||
{lib, ...}: {
|
||||
disko.devices = {
|
||||
disk.disk1 = {
|
||||
device = lib.mkDefault "/dev/vda";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
esp = {
|
||||
name = "ESP";
|
||||
size = "500M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "pool";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
lvm_vg = {
|
||||
pool = {
|
||||
type = "lvm_vg";
|
||||
lvs = {
|
||||
root = {
|
||||
size = "100%FREE";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
5
modules/servers/loki/default.nix
Normal file
5
modules/servers/loki/default.nix
Normal file
@ -0,0 +1,5 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./rimgo.nix
|
||||
];
|
||||
}
|
26
modules/servers/loki/rimgo.nix
Normal file
26
modules/servers/loki/rimgo.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{...}: {
|
||||
services.rimgo = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PORT = 3000;
|
||||
ADDRESS = "127.0.0.1";
|
||||
};
|
||||
};
|
||||
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.rimgo.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:3000";
|
||||
}
|
||||
];
|
||||
|
||||
routers.rimgo = {
|
||||
rule = "Host(`rimgo.cronyakatsuki.xyz`)";
|
||||
tls = {
|
||||
certResolver = "porkbun";
|
||||
};
|
||||
service = "rimgo";
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
let
|
||||
# SYSTEMS
|
||||
heimdall = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBs+qYjpeAEHPFUQeatNkhKbXz8+A1VAl21jgifDYJK8";
|
||||
loki = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF+xpWCoBEO/pzAwS1ZZEsiLSarvSVkdxQEo49xma2PV";
|
||||
|
||||
# USERS
|
||||
root = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBJLduAXHWJiglmfRfkBGKffzVWkJP6porxIzw6+Zz3W crony@cronyakatsuki.xyz";
|
||||
@ -8,7 +9,7 @@ let
|
||||
users = [
|
||||
root
|
||||
];
|
||||
systems = [heimdall];
|
||||
systems = [heimdall loki];
|
||||
in {
|
||||
"traefik.age".publicKeys = systems ++ users;
|
||||
"wg-heimdall.age".publicKeys = systems ++ users;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user