Add flight, more stuff with distributed builds

This commit is contained in:
Bun 2025-06-11 01:29:35 -04:00
parent 2f76f3be7e
commit 0ab856b18e
11 changed files with 218 additions and 2 deletions

View file

@ -61,7 +61,7 @@
colmena = {
meta = {
# Info
description = "The Bun Hive";
description = "The Bun Systems";
name = "bunhive";
# NixPKGs
@ -82,6 +82,7 @@
# Laptops
intuos.imports = [ ./hosts/intuos ];
jupiter.imports = [ ./hosts/jupiter ];
flight.imports = [ ./hosts/flight ];
# Servers
midas.imports = [ ./hosts/midas ];

View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackages_latest;
loader.grub.enable = true;
plymouth.enable = true;
};
}

18
hosts/flight/default.nix Normal file
View file

@ -0,0 +1,18 @@
{ ... }:
{
imports = [
./boot
./disko
./filesystems
./hardware
./services
./user
];
system = {
nixos.tags = [ "pc" ];
stateVersion = "25.05";
};
deployment.targetHost = "";
}

View file

@ -0,0 +1,106 @@
{ config, disko, ... }:
{
imports = [ disko.nixosModules.disko ];
disko.devices = {
disk = {
"${config.networking.hostName}" = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
ESP = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "${config.networking.hostName}-disk";
settings.allowDiscards = true;
passwordFile = "/tmp/secret.key";
content = {
type = "lvm_pv";
vg = "${config.networking.hostName}";
};
};
};
};
};
};
};
lvm_vg = {
"${config.networking.hostName}" = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"ssd"
];
};
"/prev" = {
mountpoint = "/prev";
mountOptions = [
"compress=zstd"
"noexec"
"ssd"
];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"ssd"
];
};
# Impermanence
"/persist" = {
mountpoint = "/persist";
mountOptions = [
"compress=zstd"
"ssd"
];
};
"/persist/.snapshots" = { };
"/persist/home" = { };
"/persist/home/.snapshots" = { };
};
};
};
swap = {
size = "8G";
content = {
type = "swap";
discardPolicy = "both";
};
};
};
};
};
};
# Needed for impermanence
fileSystems."/persist".neededForBoot = true;
}

View file

@ -0,0 +1,14 @@
{ config, ... }:
{
fileSystems = {
"/persist/storage" = {
device = "/dev/disk/by-uuid/d0d6783f-ad51-4d85-b8a9-3374f6460ef6";
fsType = "btrfs";
options = [
"nofail"
"nosuid"
"subvol=storage"
];
};
};
}

View file

@ -0,0 +1,22 @@
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [
"ahci"
"ehci_pci"
"sd_mod"
"sr_mod"
"xhci_pci"
];
kernelModules = [ "dm-snapshot" ];
};
kernelModules = [ "kvm-intel" ];
};
hardware.cpu.intel.updateMicrocode = true;
nixpkgs.hostPlatform = "x86_64-linux";
}

View file

@ -0,0 +1,11 @@
{ lib, ... }:
{
networking.useNetworkd = lib.mkForce false;
services.globalprotect.enable = true;
virtualisation = {
libvirtd.enable = true;
vmware.host.enable = true;
};
}

View file

@ -0,0 +1,8 @@
{ config, ... }:
{
home-manager.users."${config.vars.mainUser}".home = {
guifull.enable = true;
school.enable = true;
enableNixpkgsReleaseCheck = false;
};
}

View file

@ -7,6 +7,6 @@
"file://${config.home.homeDirectory}/Videos"
"file://${config.home.homeDirectory}/Photos"
"file://${config.home.homeDirectory}/Photos/Screenshots"
"file:///etc/nixos"
"file:///network"
];
}

View file

@ -1,6 +1,14 @@
{ config, lib, nodes, ... }:
{
networking.hosts = with nodes; {
# PCs
"${tower.config.deployment.targetHost}" = [ "tower" ];
"${hidden.config.deployment.targetHost}" = [ "hidden" ];
"${intuos.config.deployment.targetHost}" = [ "intuos" ];
"${jupiter.config.deployment.targetHost}" = [ "jupiter" ];
"${flight.config.deployment.targetHost}" = [ "flight" ];
# Servers
"${midas.config.deployment.targetHost}" = [ "midas" ];
"${kitty.config.deployment.targetHost}" = [ "kitty" ];
"${detritus.config.deployment.targetHost}" = [ "detritus" ];

View file

@ -1,6 +1,7 @@
{ config, lib, nodes, ... }:
{
nix = {
# Machines to build derviations on
buildMachines = with nodes; [
{
hostName = "midas";
@ -49,10 +50,29 @@
}
];
# Enable distributed builds
distributedBuilds = true;
settings = {
# Serve derivations more efficiently, using substituters
substituters = [
"ssh-ng://midas"
"ssh-ng://kitty"
"ssh-ng://detritus"
"ssh-ng://elder"
"ssh-ng://prophet"
];
trusted-public-keys = [
"midas:YpyfZyVlTlPjzcVsYBnN13EgeK95y1WXxm9h1V8tM7E="
"kitty:QLl9Do4v+2Q/fapozUGoXIKJul+Zck3yAsmAo9Lg4is="
"detritus:xtQVaIyDIBWS+EAU11dBsW9BUMT7aAZRPjKp3Udgdvc="
"elder:U+zIEvxNeqOxAWbZyrJzDNrJF1GJdcrLEYbIqmKGd7U="
"prophet:NPlWmuX1vz95uUIddQXlwrkmdSMZW1U27CdEY812brg="
];
# Settings to sign the derivations and allow building
max-jobs = if builtins.elem "server" config.system.nixos.tags then "auto" else 0;
secret-key-files = "/var/lib/nixos/cache-priv-key.pem";
trusted-users = [ "root" ];
};
};