deploy vm
This commit is contained in:
parent
20ac636eb8
commit
67c994a79d
2 changed files with 77 additions and 0 deletions
|
@ -64,6 +64,7 @@
|
||||||
let
|
let
|
||||||
microvm-list = [
|
microvm-list = [
|
||||||
"auth"
|
"auth"
|
||||||
|
"conduwuit"
|
||||||
"forgejo"
|
"forgejo"
|
||||||
"immich"
|
"immich"
|
||||||
"miniflux"
|
"miniflux"
|
||||||
|
|
76
hosts/conduwuit/default.nix
Normal file
76
hosts/conduwuit/default.nix
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
mac = "02:00:00:00:00:06";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
];
|
||||||
|
# sops.defaultSopsFile = ./secrets.yaml;
|
||||||
|
# sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
|
|
||||||
|
# sops.secrets = {
|
||||||
|
# "wg/0xa-proxy" = {
|
||||||
|
# owner = config.users.users.systemd-network.name;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
microvm = {
|
||||||
|
hypervisor = "qemu";
|
||||||
|
mem = 3 * 1024;
|
||||||
|
vcpu = 2;
|
||||||
|
interfaces = [
|
||||||
|
{
|
||||||
|
type = "tap";
|
||||||
|
id = "uvm-conduwuit";
|
||||||
|
mac = mac;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
shares =
|
||||||
|
[
|
||||||
|
{
|
||||||
|
source = "/nix/store";
|
||||||
|
mountPoint = "/nix/.ro-store";
|
||||||
|
tag = "store";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "store.socket";
|
||||||
|
}
|
||||||
|
]
|
||||||
|
++ map
|
||||||
|
(dir: {
|
||||||
|
source = dir;
|
||||||
|
mountPoint = "/${dir}";
|
||||||
|
tag = dir;
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "${dir}.socket";
|
||||||
|
})
|
||||||
|
[
|
||||||
|
"etc"
|
||||||
|
"var"
|
||||||
|
"home"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.useNetworkd = true;
|
||||||
|
networking.firewall.enable = lib.mkForce false; # firewalling done by the host
|
||||||
|
|
||||||
|
systemd.network = {
|
||||||
|
enable = true;
|
||||||
|
networks."11-host" = {
|
||||||
|
matchConfig.MACAddress = mac;
|
||||||
|
networkConfig = {
|
||||||
|
Address = "10.99.99.16/24";
|
||||||
|
DHCP = "no";
|
||||||
|
};
|
||||||
|
routes = [
|
||||||
|
{
|
||||||
|
Gateway = "10.99.99.1";
|
||||||
|
Destination = "0.0.0.0/0";
|
||||||
|
Metric = 1024;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.hostName = "conduwuit";
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue