From c991c47b75929acf09413ae4df1c2f3a51c04651 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 20 Feb 2024 17:47:50 +0100 Subject: [PATCH] feat(infra): Deploy geo01 --- machines/geo01/_configuration.nix | 17 ++++++++++ machines/geo01/_hardware-configuration.nix | 37 ++++++++++++++++++++++ machines/geo01/secrets/secrets.nix | 5 +++ meta/infrastructure.nix | 5 ++- meta/network.nix | 22 +++++++++++++ meta/nodes.nix | 5 +++ 6 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 machines/geo01/_configuration.nix create mode 100644 machines/geo01/_hardware-configuration.nix create mode 100644 machines/geo01/secrets/secrets.nix diff --git a/machines/geo01/_configuration.nix b/machines/geo01/_configuration.nix new file mode 100644 index 0000000..a402b3f --- /dev/null +++ b/machines/geo01/_configuration.nix @@ -0,0 +1,17 @@ +{ lib, ... }: + +lib.extra.mkConfig { + enabledModules = [ + # List of modules to enable + ]; + + enabledServices = [ + # List of services to enable + ]; + + extraConfig = { + services.netbird.enable = true; + }; + + root = ./.; +} diff --git a/machines/geo01/_hardware-configuration.nix b/machines/geo01/_hardware-configuration.nix new file mode 100644 index 0000000..92ced5d --- /dev/null +++ b/machines/geo01/_hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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. +{ lib, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot = { + initrd = { + availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "usb_storage" + "sd_mod" + ]; + }; + kernelModules = [ "kvm-intel" ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/87e58ba7-b70e-4f3f-96b8-b430d63feb47"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/12CE-A600"; + fsType = "vfat"; + }; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/dd12c644-ead3-4367-9198-2f7740908633"; } ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/machines/geo01/secrets/secrets.nix b/machines/geo01/secrets/secrets.nix new file mode 100644 index 0000000..c459051 --- /dev/null +++ b/machines/geo01/secrets/secrets.nix @@ -0,0 +1,5 @@ +let + lib = import ../../../lib { }; + publicKeys = lib.getNodeKeys "geo01"; +in +lib.setDefault { inherit publicKeys; } [ ] diff --git a/meta/infrastructure.nix b/meta/infrastructure.nix index 3edb423..0e1b6b6 100644 --- a/meta/infrastructure.nix +++ b/meta/infrastructure.nix @@ -8,7 +8,10 @@ ]; # Jourdan - par02 = [ "vault01" ]; + par02 = [ + "geo01" + "vault01" + ]; # VMs du SPI/NPS/Whatever dmi01 = [ diff --git a/meta/network.nix b/meta/network.nix index 68b9c92..409dbbd 100644 --- a/meta/network.nix +++ b/meta/network.nix @@ -71,6 +71,28 @@ builtins.mapAttrs mkNet { hostId = "8df60941"; }; + geo01 = { + interfaces = { + eno1 = { + ipv4 = [ + { + address = "129.199.210.194"; + prefixLength = 24; + } + ]; + + gateways = [ "129.199.210.254" ]; + }; + }; + + hostId = "b88fee0c"; + + dns = [ + "129.199.96.11" + "129.199.72.99" + ]; + }; + storage01 = { interfaces = { eno1 = { diff --git a/meta/nodes.nix b/meta/nodes.nix index 94ac890..a8b17c6 100644 --- a/meta/nodes.nix +++ b/meta/nodes.nix @@ -35,6 +35,11 @@ builtins.mapAttrs mkNode { stateVersion = "23.05"; }; + geo01 = { + stateVersion = "24.05"; + nixpkgs = "unstable"; + }; + storage01 = { stateVersion = "23.11"; };