From 710549a5229f3a09b7a0c14e08bb3f5c3151041c Mon Sep 17 00:00:00 2001 From: uku Date: Sun, 24 Mar 2024 14:02:03 +0100 Subject: [PATCH] feat(wip): add vesuvio --- configs/common.nix | 2 - systems/default.nix | 7 ++- systems/etna/default.nix | 1 + systems/vesuvio/default.nix | 8 ++++ systems/vesuvio/hardware-configuration.nix | 24 ++++++++++ systems/vesuvio/networking-stock.nix | 52 ++++++++++++++++++++++ systems/vesuvio/networking.nix | 31 +++++++++++++ 7 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 systems/vesuvio/default.nix create mode 100644 systems/vesuvio/hardware-configuration.nix create mode 100644 systems/vesuvio/networking-stock.nix create mode 100644 systems/vesuvio/networking.nix diff --git a/configs/common.nix b/configs/common.nix index 26abee6..3ff730b 100644 --- a/configs/common.nix +++ b/configs/common.nix @@ -125,8 +125,6 @@ in { openFirewall = lib.mkDefault false; }; - vscode-server.enable = true; - resolved = { enable = lib.mkDefault true; dnssec = "allow-downgrade"; diff --git a/systems/default.nix b/systems/default.nix index 4067cd0..90a72e3 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -27,7 +27,6 @@ ../configs/common.nix agenix.nixosModules.default home-manager.nixosModules.home-manager - vscode-server.nixosModules.default ]; desktop = with inputs; @@ -50,6 +49,7 @@ in { nixos ++ (with inputs; [ nixos-wsl.nixosModules.default + vscode-server.nixosModules.default ]); }; @@ -68,5 +68,10 @@ in { self.nixosModules.reposilite ]); }; + + vesuvio = { + system = "aarch64-linux"; + modules = nixos; + }; }; } diff --git a/systems/etna/default.nix b/systems/etna/default.nix index 6aea7da..27127b3 100644 --- a/systems/etna/default.nix +++ b/systems/etna/default.nix @@ -35,6 +35,7 @@ reposilite.enable = true; + vscode-server.enable = true; tailscale.extraUpFlags = ["--advertise-exit-node"]; vaultwarden = { diff --git a/systems/vesuvio/default.nix b/systems/vesuvio/default.nix new file mode 100644 index 0000000..16d248c --- /dev/null +++ b/systems/vesuvio/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./networking.nix + ]; + + boot.tmp.cleanOnBoot = true; + zramSwap.enable = true; +} diff --git a/systems/vesuvio/hardware-configuration.nix b/systems/vesuvio/hardware-configuration.nix new file mode 100644 index 0000000..3fd9f96 --- /dev/null +++ b/systems/vesuvio/hardware-configuration.nix @@ -0,0 +1,24 @@ +{modulesPath, ...}: { + imports = [(modulesPath + "/profiles/qemu-guest.nix")]; + + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"]; + boot.initrd.kernelModules = ["nvme"]; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D951-0FE6"; + fsType = "vfat"; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/ae52778a-0099-4263-9bdc-a07abf37920c"; + fsType = "ext4"; + }; + + nixpkgs.hostPlatform = "aarch64-linux"; +} diff --git a/systems/vesuvio/networking-stock.nix b/systems/vesuvio/networking-stock.nix new file mode 100644 index 0000000..34f5290 --- /dev/null +++ b/systems/vesuvio/networking-stock.nix @@ -0,0 +1,52 @@ +{lib, ...}: { + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + nameservers = [ + "8.8.8.8" + ]; + defaultGateway = "172.31.1.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + interfaces = { + eth0 = { + ipv4.addresses = [ + { + address = "49.13.148.129"; + prefixLength = 32; + } + ]; + ipv6.addresses = [ + { + address = "2a01:4f8:1c1c:8b12::1"; + prefixLength = 64; + } + { + address = "fe80::9400:3ff:fe24:4aab"; + prefixLength = 64; + } + ]; + ipv4.routes = [ + { + address = "172.31.1.1"; + prefixLength = 32; + } + ]; + ipv6.routes = [ + { + address = "fe80::1"; + prefixLength = 128; + } + ]; + }; + }; + }; + services.udev.extraRules = '' + ATTR{address}=="96:00:03:24:4a:ab", NAME="eth0" + + ''; +} diff --git a/systems/vesuvio/networking.nix b/systems/vesuvio/networking.nix new file mode 100644 index 0000000..26a5249 --- /dev/null +++ b/systems/vesuvio/networking.nix @@ -0,0 +1,31 @@ +{lib, ...}: { + # mac address + services.udev.extraRules = ''ATTR{address}=="96:00:03:24:4a:ab", NAME="eth0"''; + + networking = { + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + nameservers = ["1.1.1.1"]; + + defaultGateway = "172.31.1.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + + interfaces.eth0 = { + ipv4.addresses = [ + { + address = "49.13.148.129"; + prefixLength = 32; + } + ]; + ipv6.addresses = [ + { + address = "2a01:4f8:1c1c:8b12::1"; + prefixLength = 64; + } + ]; + }; + }; +}