mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 13:32:15 -06:00
feat: added zookeeper package to microvm
This commit is contained in:
parent
743dd70775
commit
766a177ce6
1 changed files with 22 additions and 33 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
flake,
|
flake,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -16,33 +18,30 @@ in
|
||||||
config = {
|
config = {
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
time.timeZone = "America/Winnipeg";
|
time.timeZone = "America/Winnipeg";
|
||||||
imports = [
|
|
||||||
flake.inputs.zookeeper.nixosModules.default
|
|
||||||
];
|
|
||||||
users.users.root.openssh.authorizedKeys.keys = flake.config.people.users.${user0}.sshKeys;
|
users.users.root.openssh.authorizedKeys.keys = flake.config.people.users.${user0}.sshKeys;
|
||||||
services = {
|
services.openssh = {
|
||||||
zookeeperbot.enable = true;
|
|
||||||
openssh = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings.PasswordAuthentication = false;
|
||||||
PasswordAuthentication = false;
|
|
||||||
PermitRootLogin = "prohibit-password";
|
|
||||||
};
|
};
|
||||||
};
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
22
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
|
services = {
|
||||||
|
zookeeper = {
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = lib.getExe flake.self.packages.${pkgs.system}.zookeeper;
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 2;
|
||||||
|
EnvironmentFile = "/run/secrets/env";
|
||||||
|
};
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
};
|
||||||
|
systemd-networkd.wantedBy = [ "multi-user.target" ];
|
||||||
|
};
|
||||||
network = {
|
network = {
|
||||||
enable = true;
|
enable = true;
|
||||||
networks."20-lan" = {
|
networks."20-lan" = {
|
||||||
matchConfig.Name = "enp0s5";
|
matchConfig.Name = "enp0s3";
|
||||||
addresses = [
|
addresses = [ { Address = "${serviceCfg.interface.ip}/24"; } ];
|
||||||
{ Address = "${serviceCfg.interface.ip}/24"; }
|
|
||||||
];
|
|
||||||
routes = [
|
routes = [
|
||||||
{
|
{
|
||||||
Destination = "${hostCfg.localhost.address1}/0";
|
Destination = "${hostCfg.localhost.address1}/0";
|
||||||
|
|
@ -55,18 +54,10 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
tmpfiles.rules = [
|
|
||||||
"Z ${serviceCfg.varPaths.path0} 0755 ${serviceCfg.name} ${serviceCfg.name} -"
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.systemd-networkd.wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
microvm = {
|
microvm = {
|
||||||
vcpu = 2;
|
vcpu = 1;
|
||||||
mem = 3072;
|
mem = 1024;
|
||||||
hypervisor = "qemu";
|
hypervisor = "qemu";
|
||||||
interfaces = [
|
interfaces = [
|
||||||
{
|
{
|
||||||
|
|
@ -105,12 +96,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
"${serviceCfg.name}/env" = {
|
"${serviceCfg.name}/env" = {
|
||||||
owner = "root";
|
owner = "root";
|
||||||
mode = "0600";
|
mode = "0600";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue