feat(mugetsu): nf-generate

This commit is contained in:
arcnmx 2024-11-20 10:37:13 -08:00
parent ff0c00384d
commit de12febf68
12 changed files with 229 additions and 1 deletions

View file

@ -589,6 +589,57 @@ jobs:
command: ci-build-cache command: ci-build-cache
quiet: false quiet: false
stdin: ${{ runner.temp }}/ci.build.cache stdin: ${{ runner.temp }}/ci.build.cache
mugetsu:
name: nodes-mugetsu
runs-on: ubuntu-latest
steps:
- id: checkout
name: git clone
uses: actions/checkout@v4
with:
submodules: false
- id: nix-install
name: nix install
uses: arcnmx/ci/actions/nix/install@v0.7
- id: ci-dirty
name: nix test dirty
uses: arcnmx/ci/actions/nix/run@v0.7
with:
attrs: ci.job.mugetsu.run.test
command: ci-build-dirty
quiet: false
stdout: ${{ runner.temp }}/ci.build.dirty
- id: ci-test
name: nix test build
uses: arcnmx/ci/actions/nix/run@v0.7
with:
attrs: ci.job.mugetsu.run.test
command: ci-build-realise
ignore-exit-code: true
quiet: false
stdin: ${{ runner.temp }}/ci.build.dirty
- env:
CI_EXIT_CODE: ${{ steps.ci-test.outputs.exit-code }}
id: ci-summary
name: nix test results
uses: arcnmx/ci/actions/nix/run@v0.7
with:
attrs: ci.job.mugetsu.run.test
command: ci-build-summarise
quiet: false
stdin: ${{ runner.temp }}/ci.build.dirty
stdout: ${{ runner.temp }}/ci.build.cache
- env:
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
id: ci-cache
if: always()
name: nix test cache
uses: arcnmx/ci/actions/nix/run@v0.7
with:
attrs: ci.job.mugetsu.run.test
command: ci-build-cache
quiet: false
stdin: ${{ runner.temp }}/ci.build.cache
packages: packages:
name: nodes-packages name: nodes-packages
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -141,6 +141,20 @@
} }
} }
}, },
"idrac-mugetsu": {
"network": {
"hostName": "idrac-mugetsu",
"networks": {
"int": null,
"local": {
"address4": "10.1.1.13",
"address6": null,
"macAddress": null
},
"tail": null
}
}
},
"kasen": { "kasen": {
"network": { "network": {
"hostName": "kasen", "hostName": "kasen",
@ -313,6 +327,20 @@
} }
} }
}, },
"mugetsu": {
"network": {
"hostName": "mugetsu",
"networks": {
"int": null,
"local": {
"address4": "10.1.1.60",
"address6": "fd0a::6600:6aff:fec0:a14c",
"macAddress": "64:00:6a:c0:a1:4c"
},
"tail": null
}
}
},
"nue": { "nue": {
"network": { "network": {
"hostName": "nue", "hostName": "nue",

View file

@ -18,6 +18,7 @@ eientei:: `10.1.1.5`
kvm-reisen:: `10.1.1.9` kvm-reisen:: `10.1.1.9`
idrac-gengetsu:: `10.1.1.12` idrac-gengetsu:: `10.1.1.12`
idrac-mugetsu:: `10.1.1.13`
shanghai:: `10.1.1.32` shanghai:: `10.1.1.32`
@ -38,6 +39,7 @@ kasen:: `10.1.1.49`
sakuya:: `10.1.1.50` sakuya:: `10.1.1.50`
minecraft:: `10.1.1.51` minecraft:: `10.1.1.51`
mugetsu:: `10.1.1.60`
gengetsu:: `10.1.1.61` gengetsu:: `10.1.1.61`
nue:: `10.1.1.62` nue:: `10.1.1.62`

View file

@ -13,6 +13,7 @@
data = "${nfsRoot}/kyuuto/data"; data = "${nfsRoot}/kyuuto/data";
systems = "${nfsRoot}/kyuuto/systems"; systems = "${nfsRoot}/kyuuto/systems";
gengetsu = "${nfsRoot.systems}/gengetsu"; gengetsu = "${nfsRoot.systems}/gengetsu";
mugetsu = "${nfsRoot.systems}/mugetsu";
}; };
in { in {
services.nfs = { services.nfs = {
@ -63,6 +64,24 @@ in {
}; };
}; };
}; };
"${nfsRoot.mugetsu}/root" = {
flags = flagSets.common ++ ["fsid=170"] ++ ["async"];
clients = {
mugetsu = {
machine = flagSets.mugetsuClients;
flags = flagSets.metal;
};
};
};
"${nfsRoot.mugetsu}/boot" = {
flags = flagSets.common ++ ["fsid=171"] ++ ["async"];
clients = {
mugetsu = {
machine = flagSets.mugetsuClients;
flags = flagSets.metal;
};
};
};
}; };
}; };
}; };
@ -101,5 +120,15 @@ in {
what = "${kyuuto.dataDir}/systems/gengetsu/fs/boot"; what = "${kyuuto.dataDir}/systems/gengetsu/fs/boot";
where = "${nfsRoot.gengetsu}/boot"; where = "${nfsRoot.gengetsu}/boot";
} }
{
inherit type options wantedBy before;
what = "${kyuuto.dataDir}/systems/mugetsu/fs/root";
where = "${nfsRoot.mugetsu}/root";
}
{
inherit type options wantedBy before;
what = "${kyuuto.dataDir}/systems/mugetsu/fs/boot";
where = "${nfsRoot.mugetsu}/boot";
}
]; ];
} }

View file

@ -104,6 +104,7 @@ in {
localClients = cidrForNetwork.allLan.all ++ flagSets.tailClients; localClients = cidrForNetwork.allLan.all ++ flagSets.tailClients;
allClients = flagSets.clientGroups ++ flagSets.trustedClients ++ flagSets.localClients; allClients = flagSets.clientGroups ++ flagSets.trustedClients ++ flagSets.localClients;
gengetsuClients = mkMetalClient "gengetsu"; gengetsuClients = mkMetalClient "gengetsu";
mugetsuClients = mkMetalClient "mugetsu";
}; };
root = { root = {
path = "/srv/fs"; path = "/srv/fs";

View file

@ -0,0 +1,22 @@
_: {
type = "Linux";
access = {
online.available = true;
};
network.networks = {
local = {
slaac.enable = false;
address4 = "10.1.1.13";
address6 = null;
};
};
exports = {
status.displayName = "mugetsu/IDRAC";
services = {
sshd = {
enable = true;
ports.public.enable = false;
};
};
};
}

View file

@ -0,0 +1,13 @@
_: {
arch = "x86_64";
type = "NixOS";
modules = [
./nixos.nix
];
network.networks = {
local = {
macAddress = "64:00:6a:c0:a1:4c";
address4 = "10.1.1.60";
};
};
}

View file

@ -0,0 +1,52 @@
{
config,
pkgs,
...
}: {
environment.systemPackages = [
pkgs.ipmitool
];
boot = {
initrd = {
availableKernelModules = ["ahci" "xhci_pci" "ehci_pci" "usbhid" "usb_storage" "sd_mod" "sr_mod"];
kernelModules = [];
};
kernelModules = [];
extraModulePackages = [];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
fileSystems = {
"/" = {
# TODO
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "xfs";
};
};
networking.useNetworkd = true;
systemd.network = {
networks."40-eno1" = {
inherit (config.systemd.network.links.eno1) matchConfig;
address = ["10.1.1.60/24"];
gateway = ["10.1.1.1"];
DHCP = "no";
networkConfig = {
IPv6AcceptRA = true;
};
linkConfig = {
Multicast = true;
};
};
links.eno1 = {
matchConfig = {
Type = "ether";
MACAddress = "64:00:6a:c0:a1:4c";
};
};
};
}

14
systems/mugetsu/nixos.nix Normal file
View file

@ -0,0 +1,14 @@
{
meta,
...
}: {
imports = let
inherit (meta) nixos;
in [
./hardware-configuration.nix
#nixos.sops
nixos.base
];
system.stateVersion = "24.11";
}

View file

@ -5,6 +5,8 @@
"/mnt/kyuuto-data/minecraft mnt/kyuuto-data/minecraft none bind,optional,create=dir", "/mnt/kyuuto-data/minecraft mnt/kyuuto-data/minecraft none bind,optional,create=dir",
"/mnt/kyuuto-data/systems/gengetsu/fs/root mnt/kyuuto-data/systems/gengetsu/fs/root none bind,optional,create=dir", "/mnt/kyuuto-data/systems/gengetsu/fs/root mnt/kyuuto-data/systems/gengetsu/fs/root none bind,optional,create=dir",
"/mnt/kyuuto-data/systems/gengetsu/fs/boot mnt/kyuuto-data/systems/gengetsu/fs/boot none bind,optional,create=dir", "/mnt/kyuuto-data/systems/gengetsu/fs/boot mnt/kyuuto-data/systems/gengetsu/fs/boot none bind,optional,create=dir",
"/mnt/kyuuto-data/systems/mugetsu/fs/root mnt/kyuuto-data/systems/mugetsu/fs/root none bind,optional,create=dir",
"/mnt/kyuuto-data/systems/mugetsu/fs/boot mnt/kyuuto-data/systems/mugetsu/fs/boot none bind,optional,create=dir",
"/dev/net/tun dev/net/tun none bind,optional,create=file" "/dev/net/tun dev/net/tun none bind,optional,create=file"
], ],
"lxc.cgroup2.devices.allow": [ "lxc.cgroup2.devices.allow": [

View file

@ -203,7 +203,7 @@ chmod 0775 /mnt/kyuuto-data/minecraft/simplebackups
mkkyuuto data/systems 0 0 0775 mkkyuuto data/systems 0 0 0775
nfsystemroot=/mnt/kyuuto-data/systems nfsystemroot=/mnt/kyuuto-data/systems
for nfsystem in gengetsu; do for nfsystem in gengetsu mugetsu; do
mkkyuuto data/systems/$nfsystem 0 0 0750 mkkyuuto data/systems/$nfsystem 0 0 0750
if [[ ! -d $nfsystemroot/$nfsystem/fs ]]; then if [[ ! -d $nfsystemroot/$nfsystem/fs ]]; then

View file

@ -12,6 +12,20 @@ module "gengetsu_idrac_system_records" {
net_data = local.systems.idrac-gengetsu.network net_data = local.systems.idrac-gengetsu.network
} }
module "mugetsu_system_records" {
source = "./system/records"
zone_id = cloudflare_zone.gensokyo-zone_zone.id
zone_zone = cloudflare_zone.gensokyo-zone_zone.zone
net_data = local.systems.mugetsu.network
}
module "mugetsu_idrac_system_records" {
source = "./system/records"
zone_id = cloudflare_zone.gensokyo-zone_zone.id
zone_zone = cloudflare_zone.gensokyo-zone_zone.zone
net_data = local.systems.idrac-mugetsu.network
}
module "reisen_system_records" { module "reisen_system_records" {
source = "./system/records" source = "./system/records"
zone_id = cloudflare_zone.gensokyo-zone_zone.id zone_id = cloudflare_zone.gensokyo-zone_zone.id