From be013f184e5266bbb047a114851e068fe5b2f0ef Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 4 Nov 2023 00:24:43 +0100 Subject: [PATCH] hosts/grail: init --- hosts/grail/default.nix | 25 +++++++++++++++ hosts/grail/hardware-configuration.nix | 10 ++++++ hosts/grail/system.nix | 42 ++++++++++++++++++++++++++ hosts/part.nix | 2 ++ 4 files changed, 79 insertions(+) create mode 100644 hosts/grail/default.nix create mode 100644 hosts/grail/hardware-configuration.nix create mode 100644 hosts/grail/system.nix diff --git a/hosts/grail/default.nix b/hosts/grail/default.nix new file mode 100644 index 0000000..2118a0b --- /dev/null +++ b/hosts/grail/default.nix @@ -0,0 +1,25 @@ +tools: { + ssh.enable = true; + ssh.id = with tools.dns; { + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBi5Fm2pmMBhRgJms+me1ldt9Vgj9cMSnB7UllSz3mpY"; + hostNames = subResolve "grail" "node"; + }; + + interfaces = { + primary = { + addr = "37.27.11.202"; + link = "enp1s0"; + }; + vstub = { + addr = "10.1.0.6"; + link = "vstub"; + }; + }; + + enterprise = { + subdomain = "node"; + }; + + system = "aarch64-linux"; + nixos = ./system.nix; +} diff --git a/hosts/grail/hardware-configuration.nix b/hosts/grail/hardware-configuration.nix new file mode 100644 index 0000000..1d071cb --- /dev/null +++ b/hosts/grail/hardware-configuration.nix @@ -0,0 +1,10 @@ +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + fileSystems."/boot" = { device = "/dev/disk/by-partlabel/boot"; fsType = "vfat"; }; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ]; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/disk/by-partlabel/rootfs"; fsType = "ext4"; }; +} diff --git a/hosts/grail/system.nix b/hosts/grail/system.nix new file mode 100644 index 0000000..8a13920 --- /dev/null +++ b/hosts/grail/system.nix @@ -0,0 +1,42 @@ +{ depot, ... }: + +let + inherit (depot.reflection.interfaces) primary; +in + +{ + imports = [ + ./hardware-configuration.nix + + depot.inputs.agenix.nixosModules.age + + depot.nixosModules.serverBase + ]; + + zramSwap.enable = true; + + networking.hostName = "grail"; + networking.nameservers = [ depot.hours.VEGAS.interfaces.vstub.addr ]; + + i18n.defaultLocale = "en_US.UTF-8"; + + services.openssh.enable = true; + + time.timeZone = "Europe/Helsinki"; + + networking = { + defaultGateway = "172.31.1.1"; + useDHCP = false; + dhcpcd.enable = false; + interfaces = { + ${primary.link} = { + ipv4.addresses = [ + { address = primary.addr; prefixLength = 32; } + ]; + ipv4.routes = [ { address = "172.31.1.1"; prefixLength = 32; } ]; + }; + }; + }; + + system.stateVersion = "23.05"; +} diff --git a/hosts/part.nix b/hosts/part.nix index 5396fba..95f1f5c 100644 --- a/hosts/part.nix +++ b/hosts/part.nix @@ -16,6 +16,8 @@ in with tools.dns; VEGAS = import ./VEGAS tools; prophet = import ./prophet tools; + + grail = import ./grail tools; }; fromFlesh = {