summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
authorJakub Stachurski <jakub@wilkuu.xyz>2026-05-30 23:31:28 +0200
committerJakub Stachurski <jakub@wilkuu.xyz>2026-05-30 23:31:28 +0200
commitcede216aee3e9df92c3fe5acff44715ab703aeca (patch)
tree51d571fc94647147fcd38114e20e98e97c63098c /hosts
parentaa39875b09ebe74db959ab4decd642148abc2860 (diff)
Initial commit
Diffstat (limited to 'hosts')
-rw-r--r--hosts/aperture/default.nix72
-rw-r--r--hosts/aperture/disko.nix64
-rw-r--r--hosts/aperture/testbed.nix28
3 files changed, 164 insertions, 0 deletions
diff --git a/hosts/aperture/default.nix b/hosts/aperture/default.nix
new file mode 100644
index 0000000..ded949c
--- /dev/null
+++ b/hosts/aperture/default.nix
@@ -0,0 +1,72 @@
+{ lib, modulesPath, ... }:
+{
+ imports = [
+ (modulesPath + "/profiles/qemu-guest.nix")
+ ./disko.nix
+ ./testbed.nix
+ ];
+
+ boot.initrd.availableKernelModules = [
+ "uhci_hcd"
+ "ehci_pci"
+ "ahci"
+ "virtio_pci"
+ "virtio_scsi"
+ "sd_mod"
+ "sr_mod"
+ ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ 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 = true;
+ hostName = "aperture";
+ nftables.enable = true;
+ useNetworkd = true;
+ };
+
+ systemd.network = {
+ enable = true;
+ networks."10-uplink" = {
+ matchConfig.Type = "ether";
+ networkConfig = {
+ DHCP = "ipv4";
+ IPv6AcceptRA = "yes";
+ };
+ linkConfig = {
+ RequiredForOnline = "yes";
+ };
+ };
+ };
+
+ boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
+ boot.loader.limine = {
+ efiSupport = true;
+ enable = true;
+ secureBoot = {
+ enable = false;
+ };
+ };
+
+ # SSH Access
+ services.openssh = {
+ enable = true;
+ ports = [ 22 ];
+ openFirewall = true;
+ allowSFTP = true;
+ settings = {
+ PasswordAuthentication = false;
+ AllowUsers = [ "wilkuu" ];
+ X11Forwarding = true;
+ PermitRootLogin = "no";
+ };
+ };
+
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+}
diff --git a/hosts/aperture/disko.nix b/hosts/aperture/disko.nix
new file mode 100644
index 0000000..9727cd3
--- /dev/null
+++ b/hosts/aperture/disko.nix
@@ -0,0 +1,64 @@
+{ ... }:
+{
+ services.btrfs.autoScrub = {
+ enable = true;
+ interval = "weekly";
+ };
+
+ disko.devices = {
+ disk = {
+ main = {
+ device = "/dev/vda";
+ content = {
+ type = "gpt";
+ partitions = {
+ ESP = {
+ type = "EF00";
+ size = "512M";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = [ "umask=0077" ];
+ };
+ };
+ root = {
+ size = "100%";
+ content = {
+ type = "btrfs";
+ extraArgs = [ "-f" ];
+ subvolumes = {
+ # Subvolume name is different from mountpoint
+ "/rootfs" = {
+ mountOptions = [ "compress=zstd" ];
+ mountpoint = "/";
+ };
+ # Subvolume name is the same as the mountpoint
+ "/home" = {
+ mountOptions = [ "compress=zstd" ];
+ mountpoint = "/home";
+ };
+ # Parent is not mounted so the mountpoint must be set
+ "/nix" = {
+ mountOptions = [
+ "compress=zstd"
+ "noatime"
+ ];
+ mountpoint = "/nix";
+ };
+ # Subvolume for the swapfile
+ "/swap" = {
+ mountpoint = "/.swapvol";
+ swap = {
+ swapfile.size = "8G";
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/hosts/aperture/testbed.nix b/hosts/aperture/testbed.nix
new file mode 100644
index 0000000..479de4a
--- /dev/null
+++ b/hosts/aperture/testbed.nix
@@ -0,0 +1,28 @@
+{ ... }:
+{
+ imports = [ ../../services/mail2.nix ];
+ wilkuu.services.test_endpoint = {
+ enable = true;
+ doACME = false;
+ port = 9999;
+ domain = "test.aperture.local";
+ };
+
+ wilkuu.services.mail = {
+ enable = true;
+ doACME = false;
+ defaultDomain = "mail.aperture.local";
+ domains = [ "mail.aperture.local" ];
+ wellKnownDomains = [ "aperture.local" ];
+ startupMode = "bootstrap";
+ };
+
+ lldap = {
+ enable = false;
+ environmentFile = null;
+ settings = {
+
+
+ };
+ };
+}