Compare commits

...

4 Commits

6 changed files with 49 additions and 33 deletions

View File

@@ -3,6 +3,16 @@
inputs, inputs,
}: }:
let
mkNode = hostname: tags: {
imports = [ ../hosts/${hostname} ];
deployment = {
targetHost = self.nixosConfigurations.${hostname}.config.ssh.publicHostname;
targetUser = self.nixosConfigurations.${hostname}.config.ssh.username;
inherit tags;
};
};
in
inputs.colmena.lib.makeHive { inputs.colmena.lib.makeHive {
meta = { meta = {
nixpkgs = import inputs.nixpkgs { nixpkgs = import inputs.nixpkgs {
@@ -13,34 +23,9 @@ inputs.colmena.lib.makeHive {
nodeSpecialArgs = builtins.mapAttrs (_: v: v._module.specialArgs or { }) self.nixosConfigurations; nodeSpecialArgs = builtins.mapAttrs (_: v: v._module.specialArgs or { }) self.nixosConfigurations;
}; };
astyanax = { astyanax = mkNode "astyanax" [ "local" ];
imports = [ ../hosts/astyanax ]; andromache = mkNode "andromache" [ "local" ];
deployment.tags = [ "local" ]; vm = mkNode "vm" [ "local" ];
}; hecuba = mkNode "hecuba" [ "cloud" ];
eetion = mkNode "eetion" [ "arm" ];
andromache = {
imports = [ ../hosts/andromache ];
deployment.tags = [ "local" ];
};
vm = {
imports = [ ../hosts/vm ];
deployment.tags = [ "local" ];
};
hecuba = {
imports = [ ../hosts/hecuba ];
deployment = {
targetUser = "username";
tags = [ "cloud" ];
};
};
eetion = {
imports = [ ../hosts/eetion ];
deployment = {
targetUser = "h";
tags = [ "arm" ];
};
};
} }

View File

@@ -18,8 +18,20 @@ in
enable = true; enable = true;
enableDefaultConfig = false; enableDefaultConfig = false;
matchBlocks = lib.genAttrs hostsWithKeys (hostname: { matchBlocks = lib.genAttrs hostsWithKeys (
host = hostname; hostname:
}); let
hostConfig = outputs.nixosConfigurations.${hostname}.config;
publicHostname = hostConfig.ssh.publicHostname;
targetUser = hostConfig.ssh.username;
in
{
host = hostname;
user = targetUser;
}
// lib.optionalAttrs (publicHostname != "") {
hostname = publicHostname;
}
);
}; };
} }

View File

@@ -91,6 +91,8 @@ in
hostId = "80eef97e"; hostId = "80eef97e";
}; };
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
services = { services = {
fwupd.enable = true; fwupd.enable = true;
openssh = { openssh = {

View File

@@ -42,6 +42,18 @@ in
harden = true; harden = true;
}; };
virtualisation = {
podman.enable = true;
oci-containers = {
backend = "podman";
containers.actualbudget = {
image = "docker.io/actualbudget/actual-server:latest-alpine";
ports = [ "5006:5006" ];
volumes = [ "/var/lib/actualbudget:/data" ];
};
};
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vim vim
git git

View File

@@ -24,6 +24,7 @@ in
networking.hostName = hostName; networking.hostName = hostName;
ssh.username = username; ssh.username = username;
ssh.publicHostname = "server.hektormisplon.xyz";
ssh.authorizedHosts = [ ssh.authorizedHosts = [
"andromache" "andromache"
"astyanax" "astyanax"

View File

@@ -9,6 +9,10 @@
type = lib.types.str; type = lib.types.str;
default = "h"; default = "h";
}; };
publicHostname = lib.mkOption {
type = lib.types.str;
default = "";
};
}; };
# auto generate authorized_keys from `authorizedHosts` # auto generate authorized_keys from `authorizedHosts`