Skip to content

Commit

Permalink
Add machine boop
Browse files Browse the repository at this point in the history
  • Loading branch information
ifd3f committed Mar 25, 2024
1 parent 425a9cc commit 8fa47b8
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 2 deletions.
3 changes: 3 additions & 0 deletions machines/boop/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
31 changes: 31 additions & 0 deletions machines/boop/boot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
inputs:
{ 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 = [ ];

# because we want to be able to decrypt host keys over SSH
boot.initrd.network.ssh = {
enable = true;
authorizedKeys = inputs.self.lib.sshKeyDatabase.users.astrid;
};

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

inputs.self.nixosModules.server

(import ./boot.nix inputs)
./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.enable = mkForce false;

backup.db.enable = false;
};

time.timeZone = "US/Pacific";

networking = {
hostName = "boop";
domain = "h.astrid.tech";

hostId = "49e32584"; # Required for ZFS
};

services.nginx = {
enable = true;

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

fileSystems."/" = {
device = "rootfs";
fsType = "tmpfs";
};

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

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

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

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

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

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

swapDevices = [ ];
}
1 change: 1 addition & 0 deletions machines/boop/machine-info.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ arch = "x86_64-linux"; }
4 changes: 4 additions & 0 deletions machines/boop/net.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
networking.useDHCP = false;
networking.interfaces.eno1.useDHCP = true;
}
5 changes: 3 additions & 2 deletions nix/nixos-modules/roles/server.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Some headless server that likely runs 24/7
inputs:
{ config, lib, pkgs, ... }: {
{ config, lib, pkgs, ... }:
with lib; {
# Auto-optimize/GC store on a much more frequent basis than the PC's.
nix.gc = lib.mkForce {
automatic = true;
Expand Down Expand Up @@ -29,7 +30,7 @@ inputs:
monitoring-node.enable = true;
mount-root-to-home.enable = true;

tailscale.enable = true;
tailscale.enable = mkDefault true;

users = {
github.enable = true;
Expand Down

0 comments on commit 8fa47b8

Please sign in to comment.