Add flight, more stuff with distributed builds
This commit is contained in:
parent
2f76f3be7e
commit
0ab856b18e
11 changed files with 218 additions and 2 deletions
|
@ -61,7 +61,7 @@
|
||||||
colmena = {
|
colmena = {
|
||||||
meta = {
|
meta = {
|
||||||
# Info
|
# Info
|
||||||
description = "The Bun Hive";
|
description = "The Bun Systems";
|
||||||
name = "bunhive";
|
name = "bunhive";
|
||||||
|
|
||||||
# NixPKGs
|
# NixPKGs
|
||||||
|
@ -82,6 +82,7 @@
|
||||||
# Laptops
|
# Laptops
|
||||||
intuos.imports = [ ./hosts/intuos ];
|
intuos.imports = [ ./hosts/intuos ];
|
||||||
jupiter.imports = [ ./hosts/jupiter ];
|
jupiter.imports = [ ./hosts/jupiter ];
|
||||||
|
flight.imports = [ ./hosts/flight ];
|
||||||
|
|
||||||
# Servers
|
# Servers
|
||||||
midas.imports = [ ./hosts/midas ];
|
midas.imports = [ ./hosts/midas ];
|
||||||
|
|
8
hosts/flight/boot/default.nix
Normal file
8
hosts/flight/boot/default.nix
Normal 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
18
hosts/flight/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./boot
|
||||||
|
./disko
|
||||||
|
./filesystems
|
||||||
|
./hardware
|
||||||
|
./services
|
||||||
|
./user
|
||||||
|
];
|
||||||
|
|
||||||
|
system = {
|
||||||
|
nixos.tags = [ "pc" ];
|
||||||
|
stateVersion = "25.05";
|
||||||
|
};
|
||||||
|
|
||||||
|
deployment.targetHost = "";
|
||||||
|
}
|
106
hosts/flight/disko/default.nix
Normal file
106
hosts/flight/disko/default.nix
Normal 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;
|
||||||
|
}
|
14
hosts/flight/filesystems/default.nix
Normal file
14
hosts/flight/filesystems/default.nix
Normal 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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
22
hosts/flight/hardware/default.nix
Normal file
22
hosts/flight/hardware/default.nix
Normal 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";
|
||||||
|
}
|
11
hosts/flight/services/default.nix
Normal file
11
hosts/flight/services/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
networking.useNetworkd = lib.mkForce false;
|
||||||
|
|
||||||
|
services.globalprotect.enable = true;
|
||||||
|
|
||||||
|
virtualisation = {
|
||||||
|
libvirtd.enable = true;
|
||||||
|
vmware.host.enable = true;
|
||||||
|
};
|
||||||
|
}
|
8
hosts/flight/user/default.nix
Normal file
8
hosts/flight/user/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
home-manager.users."${config.vars.mainUser}".home = {
|
||||||
|
guifull.enable = true;
|
||||||
|
school.enable = true;
|
||||||
|
enableNixpkgsReleaseCheck = false;
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,6 +7,6 @@
|
||||||
"file://${config.home.homeDirectory}/Videos"
|
"file://${config.home.homeDirectory}/Videos"
|
||||||
"file://${config.home.homeDirectory}/Photos"
|
"file://${config.home.homeDirectory}/Photos"
|
||||||
"file://${config.home.homeDirectory}/Photos/Screenshots"
|
"file://${config.home.homeDirectory}/Photos/Screenshots"
|
||||||
"file:///etc/nixos"
|
"file:///network"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
{ config, lib, nodes, ... }:
|
{ config, lib, nodes, ... }:
|
||||||
{
|
{
|
||||||
networking.hosts = with 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" ];
|
"${midas.config.deployment.targetHost}" = [ "midas" ];
|
||||||
"${kitty.config.deployment.targetHost}" = [ "kitty" ];
|
"${kitty.config.deployment.targetHost}" = [ "kitty" ];
|
||||||
"${detritus.config.deployment.targetHost}" = [ "detritus" ];
|
"${detritus.config.deployment.targetHost}" = [ "detritus" ];
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{ config, lib, nodes, ... }:
|
{ config, lib, nodes, ... }:
|
||||||
{
|
{
|
||||||
nix = {
|
nix = {
|
||||||
|
# Machines to build derviations on
|
||||||
buildMachines = with nodes; [
|
buildMachines = with nodes; [
|
||||||
{
|
{
|
||||||
hostName = "midas";
|
hostName = "midas";
|
||||||
|
@ -49,10 +50,29 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Enable distributed builds
|
||||||
distributedBuilds = true;
|
distributedBuilds = true;
|
||||||
|
|
||||||
settings = {
|
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;
|
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" ];
|
trusted-users = [ "root" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue