Add definition for amd-legacy-hexcore

This is merged between the existing sync system and the existing
nixos-anywhere definition for amd-legacy-hexcore. I'm going to attempt
to bring in a new pattern.
This commit is contained in:
Eli Ribble 2025-10-07 16:33:48 +00:00
parent 6f89f0fe56
commit 0abca6a86d
6 changed files with 195 additions and 0 deletions

View file

@ -0,0 +1,33 @@
{
modulesPath,
lib,
pkgs,
...
} @ args:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
./disk-config.nix
./network.nix
];
boot.loader.grub = {
# no need to set devices, disko will add all devices that have a EF02 partition to the list already
# devices = [ ];
efiSupport = true;
efiInstallAsRemovable = true;
};
environment.systemPackages = map lib.lowPrio [
pkgs.curl
pkgs.dig
pkgs.gitMinimal
];
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys =
[
# change this to your ssh key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBvhtF6nRWlA6PVs71Eek7p0p2PxTd3P6ZEGFV2t75MB eliribble@nixos"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHL1SpT3KR8XeXtH19muncYVrKxWzWdWtJYNTwoJGTm3 eliribble@Elis-Mac-mini.local"
] ++ (args.extraPublicKeys or []); # this is used for unit-testing this module and can be removed if not needed
system.stateVersion = "25.05";
}

View file

@ -0,0 +1,6 @@
{
imports = [
./configuration.nix
./hardware-configuration.nix
];
}

View file

@ -0,0 +1,89 @@
# Example to create a bios compatible gpt partition
{ lib, ... }:
{
disko.devices = {
disk = {
root = {
device = "/dev/sda";
type = "disk";
content = {
type = "gpt";
partitions = {
MBR = {
size = "1M";
type = "EF02"; # for grub MBR
};
boot = {
size = "500M";
type = "EF00"; # for grub MBR
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
root = {
size = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
data = {
device = "/dev/sdb";
type = "disk";
content = {
type = "gpt";
partitions = {
bigdisk = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/mnt/bigdisk";
mountOptions = [
"defaults"
];
};
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "50G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
"defaults"
];
};
};
var = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/var";
mountOptions = [
"defaults"
];
};
};
};
};
};
};
}

View file

@ -0,0 +1,26 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "xhci_pci" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,37 @@
{ lib, ... }:
{
networking = {
defaultGateway = {
address = "63.141.227.153";
interface = "enp3s0";
};
defaultGateway6 = {
address = "2604:4300:a:88::1";
interface = "enp3s0";
};
domain = "gleipnir.technology";
firewall = {
enable = true;
interfaces.enp3s0 = {
allowedUDPPorts = [ 22 80 443 ];
allowedTCPPorts = [ 22 80 443 ];
};
};
hostName = "nocix-amd-legacy-hexcore";
interfaces.enp3s0 = {
ipv4.addresses = [{
address = "63.141.227.154";
prefixLength = 29;
}];
ipv6.addresses = [{
address = "2604:4300:a:88::2";
prefixLength = 64;
}];
};
nameservers = ["8.8.8.8"];
networkmanager.enable = false;
nftables.enable = true;
useNetworkd = true;
search = ["nocix.net"];
};
}

4
roles/nidus-sync.nix Normal file
View file

@ -0,0 +1,4 @@
{ config, lib, pkgs, ... }: {
myModules.caddy.enable = true;
myModules.fieldseeker-sync.enable = true;
}