summaryrefslogtreecommitdiff
path: root/machines/lapin
diff options
context:
space:
mode:
Diffstat (limited to 'machines/lapin')
-rw-r--r--machines/lapin/default.nix35
-rw-r--r--machines/lapin/devices.nix46
-rw-r--r--machines/lapin/hardware.nix38
-rw-r--r--machines/lapin/home.nix11
4 files changed, 130 insertions, 0 deletions
diff --git a/machines/lapin/default.nix b/machines/lapin/default.nix
new file mode 100644
index 0000000..2047cba
--- /dev/null
+++ b/machines/lapin/default.nix
@@ -0,0 +1,35 @@
+{ me, pkgs, lib, ... }:
+
+{
+ imports = [
+ ../../modules/common.nix
+
+ ./hardware.nix
+ ./devices.nix
+
+ ../../modules/www.nix
+ ];
+
+ services.nginx.virtualHosts = {
+ "soc.rnrd.eu" = {
+ forceSSL = true;
+ enableACME = true;
+
+ locations."/" = {
+ proxyWebsockets = true;
+ proxyPass = "http://127.0.0.1:1111";
+ };
+ };
+
+ "matrix.rnrd.eu" = {
+ forceSSL = true;
+ enableACME = true;
+
+ locations."/_matrix" = {
+ proxyPass = "http://127.0.0.1:8008";
+ };
+ };
+ };
+
+ system.stateVersion = "23.05";
+}
diff --git a/machines/lapin/devices.nix b/machines/lapin/devices.nix
new file mode 100644
index 0000000..f7538a3
--- /dev/null
+++ b/machines/lapin/devices.nix
@@ -0,0 +1,46 @@
+{ lib, ... }:
+
+{
+ # Boot!
+ boot.loader.systemd-boot.enable = true;
+
+ networking = {
+ # Network configuration is managed with networkd.
+ useDHCP = false;
+ nameservers = [
+ "1.1.1.1" "1.0.0.1"
+ "2606:4700:4700::1111" "2606:4700:4700::1001"
+ ];
+ };
+
+ # Static IPv6 network configuration
+ # + soliciting of IPv4 via DHCP.
+ systemd.network.enable = true;
+ systemd.network.networks."10-wan" = {
+ name = "enp1s0";
+ DHCP = "ipv4";
+ address = [ "2a01:4f8:c012:9493::1" ];
+ routes = [ { routeConfig.Gateway = "fe80::1"; } ];
+ };
+
+ services.resolved = {
+ # LLMNR and MulticastDNS both give DNS timeouts.
+ # MDNS specifically for some reason gives Docker bridge interfaces it's scope,
+ # which means every DNS request waits for an answer... from every interface...
+ llmnr = "false";
+ extraConfig = "MulticastDNS=no";
+ dnssec = "false"; # DNSSEC breaks IPv6, for some reason :(
+ };
+
+ virtualisation.docker.daemon.settings = {
+ "experimental" = true;
+ "ipv6" = true;
+ "ip6tables" = true;
+ "fixed-cidr-v6" = "fc00:d0c:b1b1::/48";
+ "bip" = "172.17.0.1/24";
+ "default-address-pools" = [
+ { base = "172.17.0.0/16"; size = 24; }
+ { base = "fc00:d0c::/32"; size = 48; }
+ ];
+ };
+}
diff --git a/machines/lapin/hardware.nix b/machines/lapin/hardware.nix
new file mode 100644
index 0000000..b33eb26
--- /dev/null
+++ b/machines/lapin/hardware.nix
@@ -0,0 +1,38 @@
+# Do not modify this file! It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations. Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+ imports =
+ [ (modulesPath + "/profiles/qemu-guest.nix")
+ ];
+
+ boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" "sr_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/bf63f1e9-416c-4bba-b0e4-3ab1b53414db";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/ADF6-F1B5";
+ fsType = "vfat";
+ };
+
+ swapDevices =
+ [ { device = "/dev/disk/by-uuid/15e0485e-dff2-4eb5-9a4d-12c69baa3db1"; }
+ ];
+
+ # 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 = lib.mkDefault true;
+ # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
+
+ nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
+}
diff --git a/machines/lapin/home.nix b/machines/lapin/home.nix
new file mode 100644
index 0000000..8d846d6
--- /dev/null
+++ b/machines/lapin/home.nix
@@ -0,0 +1,11 @@
+{ pkgs, ... }:
+
+{
+ imports = [
+ ../../modules/home/common.nix
+ ];
+
+ # lapin only got a home-manager
+ # a year after i set it up!
+ home.stateVersion = "24.05";
+}