diff --git a/flake.nix b/flake.nix index 1c10c3e..a75a656 100644 --- a/flake.nix +++ b/flake.nix @@ -73,6 +73,7 @@ "nat" = mkSystem "aarch64-linux" nixpkgs ./machines/nat/configuration.nix; "liza" = mkSystem "x86_64-linux" nixpkgs ./machines/liza/configuration.nix; "ponyo" = mkSystem "x86_64-linux" nixpkgs ./machines/ponyo/configuration.nix; + "router" = mkSystem "x86_64-linux" nixpkgs-unstable ./machines/router/configuration.nix; "s0" = mkSystem "aarch64-linux" nixpkgs-unstable ./machines/storage/s0/configuration.nix; "n1" = mkSystem "aarch64-linux" nixpkgs ./machines/compute/n1/configuration.nix; "n2" = mkSystem "aarch64-linux" nixpkgs ./machines/compute/n2/configuration.nix; diff --git a/machines/ephemeral/minimal.nix b/machines/ephemeral/minimal.nix index faa084b..5938482 100644 --- a/machines/ephemeral/minimal.nix +++ b/machines/ephemeral/minimal.nix @@ -8,7 +8,7 @@ boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "e1000" "e1000e" "virtio_pci" "r8169" ]; boot.kernelParams = [ "panic=30" "boot.panic_on_fail" # reboot the machine upon fatal boot issues - "console=ttyS0" # enable serial console + "console=ttyS0,115200" # enable serial console "console=tty1" ]; boot.kernel.sysctl."vm.overcommit_memory" = "1"; diff --git a/machines/router/configuration.nix b/machines/router/configuration.nix new file mode 100644 index 0000000..5954b80 --- /dev/null +++ b/machines/router/configuration.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ]; + + # jxx2exuihlls2t6ncs7rvrjh2dssubjmjtclwr2ysvxtr4t7jv55xmqd.onion + + networking.hostName = "router"; + + services.zerotierone.enable = true; + + system.autoUpgrade.enable = true; + + networking.useDHCP = lib.mkForce true; +} \ No newline at end of file diff --git a/machines/router/hardware-configuration.nix b/machines/router/hardware-configuration.nix new file mode 100644 index 0000000..5df36fd --- /dev/null +++ b/machines/router/hardware-configuration.nix @@ -0,0 +1,47 @@ +{ config, pkgs, ... }: + +{ + # kernel + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.initrd.availableKernelModules = [ "igb" "mt7915e" "xhci_pci" "ahci" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + # Enable serial output + boot.kernelParams = [ + "panic=30" "boot.panic_on_fail" # reboot the machine upon fatal boot issues + "console=ttyS0,115200" # enable serial console + "console=tty1" + ]; + + # firmware + firmware.x86_64.enable = true; + hardware.enableAllFirmware = true; + nixpkgs.config.allowUnfree = true; + + # boot + bios = { + enable = true; + device = "/dev/sda"; + }; + + # disks + luks = { + enable = true; + device.path = "/dev/disk/by-uuid/9b090551-f78e-45ca-8570-196ed6a4af0c"; + }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/421c82b9-d67c-4811-8824-8bb57cb10fce"; + fsType = "btrfs"; + }; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/d97f324f-3a2e-4b84-ae2a-4b3d1209c689"; + fsType = "ext3"; + }; + swapDevices = + [ { device = "/dev/disk/by-uuid/45bf58dd-67eb-45e4-9a98-246e23fa7abd"; } + ]; + + nixpkgs.hostPlatform = "x86_64-linux"; +}