Skip to content

Commit

Permalink
Add xn--vp9h machine
Browse files Browse the repository at this point in the history
  • Loading branch information
ifd3f committed Dec 18, 2023
1 parent 115fcf1 commit d555f96
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 0 deletions.
3 changes: 3 additions & 0 deletions machines/xn--vp9h/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `xn--vp9h` (pronounced 🤓)

another server for applications and compute and stuff
24 changes: 24 additions & 0 deletions machines/xn--vp9h/boot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ config, lib, ... }:
with lib; {
boot.loader = {
efi.canTouchEfiVariables = true;

grub = {
enable = true;
devices = [ "nodev" ];
efiSupport = true;
useOSProber = true;
splashImage = ./nerd-emoji.jpg;
};
};

boot.initrd.availableKernelModules =
[ "xhci_pci" "ehci_pci" "uhci_hcd" "hpsa" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

nixpkgs.hostPlatform = "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
mkDefault config.hardware.enableRedistributableFirmware;
}
48 changes: 48 additions & 0 deletions machines/xn--vp9h/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
inputs:
{ config, pkgs, lib, modulesPath, ... }:
with lib; {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")

inputs.self.nixosModules.server

./boot.nix
./fs.nix
./net.nix
];

# Logrotate config build fail workaround
# https://discourse.nixos.org/t/logrotate-config-fails-due-to-missing-group-30000/28501
services.logrotate.checkConfig = false;

astral = {
users.alia.enable = true;
virt = {
docker.enable = true;
libvirt.enable = true;
};
monitoring-node.scrapeTransport = "tailscale";
tailscale.oneOffKey =
"tskey-auth-kAYrVT7CNTRL-KwYTz4f64XK8yDjkZ9ydVKhRdTm47NpVN";

backup.db.enable = false;
};

time.timeZone = "US/Pacific";

networking = {
hostName = "xn--vp9h";
domain = "h.astrid.tech";

hostId = "dab38c19"; # Required for ZFS
};

services.nginx = {
enable = true;

clientMaxBodySize = "16m";
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
};
}
41 changes: 41 additions & 0 deletions machines/xn--vp9h/fs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
boot.zfs.forceImportAll = true;

fileSystems."/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=256M" "mode=755" ];
};

fileSystems."/nix" = {
device = "ssd/nix";
fsType = "zfs";
};

fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D30E-26C7";
fsType = "vfat";
};

fileSystems."/home" = {
device = "ssd/home";
fsType = "zfs";
};

fileSystems."/var" = {
device = "ssd/var";
fsType = "zfs";
};

fileSystems."/etc" = {
device = "ssd/etc";
fsType = "zfs";
};

fileSystems."/tmp" = {
device = "ssd/tmp";
fsType = "zfs";
};

swapDevices = [ ];
}
1 change: 1 addition & 0 deletions machines/xn--vp9h/machine-info.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ arch = "x86_64-linux"; }
Binary file added machines/xn--vp9h/nerd-emoji.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions machines/xn--vp9h/net.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
networking = {
useDHCP = false;
interfaces."br0".useDHCP = true;
bridges."br0".interfaces = [ "eno4" ];
};
}

0 comments on commit d555f96

Please sign in to comment.