mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(mugetsu): nf-generate
This commit is contained in:
parent
ff0c00384d
commit
de12febf68
12 changed files with 229 additions and 1 deletions
51
.github/workflows/nodes.yml
vendored
51
.github/workflows/nodes.yml
vendored
|
|
@ -589,6 +589,57 @@ jobs:
|
|||
command: ci-build-cache
|
||||
quiet: false
|
||||
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:
|
||||
name: nodes-packages
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
"network": {
|
||||
"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": {
|
||||
"network": {
|
||||
"hostName": "nue",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ eientei:: `10.1.1.5`
|
|||
kvm-reisen:: `10.1.1.9`
|
||||
|
||||
idrac-gengetsu:: `10.1.1.12`
|
||||
idrac-mugetsu:: `10.1.1.13`
|
||||
|
||||
shanghai:: `10.1.1.32`
|
||||
|
||||
|
|
@ -38,6 +39,7 @@ kasen:: `10.1.1.49`
|
|||
sakuya:: `10.1.1.50`
|
||||
minecraft:: `10.1.1.51`
|
||||
|
||||
mugetsu:: `10.1.1.60`
|
||||
gengetsu:: `10.1.1.61`
|
||||
|
||||
nue:: `10.1.1.62`
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
data = "${nfsRoot}/kyuuto/data";
|
||||
systems = "${nfsRoot}/kyuuto/systems";
|
||||
gengetsu = "${nfsRoot.systems}/gengetsu";
|
||||
mugetsu = "${nfsRoot.systems}/mugetsu";
|
||||
};
|
||||
in {
|
||||
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";
|
||||
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";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ in {
|
|||
localClients = cidrForNetwork.allLan.all ++ flagSets.tailClients;
|
||||
allClients = flagSets.clientGroups ++ flagSets.trustedClients ++ flagSets.localClients;
|
||||
gengetsuClients = mkMetalClient "gengetsu";
|
||||
mugetsuClients = mkMetalClient "mugetsu";
|
||||
};
|
||||
root = {
|
||||
path = "/srv/fs";
|
||||
|
|
|
|||
22
systems/idrac-mugetsu/default.nix
Normal file
22
systems/idrac-mugetsu/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
13
systems/mugetsu/default.nix
Normal file
13
systems/mugetsu/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
52
systems/mugetsu/hardware-configuration.nix
Normal file
52
systems/mugetsu/hardware-configuration.nix
Normal 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
14
systems/mugetsu/nixos.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
meta,
|
||||
...
|
||||
}: {
|
||||
imports = let
|
||||
inherit (meta) nixos;
|
||||
in [
|
||||
./hardware-configuration.nix
|
||||
#nixos.sops
|
||||
nixos.base
|
||||
];
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
}
|
||||
|
|
@ -5,6 +5,8 @@
|
|||
"/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/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"
|
||||
],
|
||||
"lxc.cgroup2.devices.allow": [
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ chmod 0775 /mnt/kyuuto-data/minecraft/simplebackups
|
|||
|
||||
mkkyuuto data/systems 0 0 0775
|
||||
nfsystemroot=/mnt/kyuuto-data/systems
|
||||
for nfsystem in gengetsu; do
|
||||
for nfsystem in gengetsu mugetsu; do
|
||||
mkkyuuto data/systems/$nfsystem 0 0 0750
|
||||
|
||||
if [[ ! -d $nfsystemroot/$nfsystem/fs ]]; then
|
||||
|
|
|
|||
|
|
@ -12,6 +12,20 @@ module "gengetsu_idrac_system_records" {
|
|||
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" {
|
||||
source = "./system/records"
|
||||
zone_id = cloudflare_zone.gensokyo-zone_zone.id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue